Compiles for Nano-X again
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14589 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -650,7 +650,7 @@ static wxNativeFont wxLoadQueryFont(int pointSize,
|
|||||||
// In fact pointSize is 10 * the normal point size so
|
// In fact pointSize is 10 * the normal point size so
|
||||||
// divide by 10.
|
// divide by 10.
|
||||||
|
|
||||||
int pixelHeight = (int) ( (((float)pointSize) / 720.0) * 2.541 * (float) yPixelsPerCM * fudgeFactor) ;
|
int pixelHeight = (int) ( (((float)pointSize) / 720.0) * 2.541 * (float) yPixelsPerCM) ;
|
||||||
|
|
||||||
// An alternative: assume that the screen is 72 dpi.
|
// An alternative: assume that the screen is 72 dpi.
|
||||||
//int pixelHeight = (int) (((float)pointSize / 720.0) * 72.0) ;
|
//int pixelHeight = (int) (((float)pointSize / 720.0) * 72.0) ;
|
||||||
|
@@ -22,6 +22,9 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/x11/reparent.h"
|
#include "wx/x11/reparent.h"
|
||||||
|
|
||||||
|
#if !wxUSE_NANOX
|
||||||
|
|
||||||
#include "wx/evtloop.h"
|
#include "wx/evtloop.h"
|
||||||
#include "wx/log.h"
|
#include "wx/log.h"
|
||||||
#include "wx/app.h"
|
#include "wx/app.h"
|
||||||
@@ -327,3 +330,4 @@ WXWindow wxReparenter::FindAClientWindow(WXWindow window, const wxString& name)
|
|||||||
} return (WXWindow) result;
|
} return (WXWindow) result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
@@ -586,6 +586,7 @@ void wxTopLevelWindowX11::DoSetClientSize(int width, int height)
|
|||||||
{
|
{
|
||||||
wxWindowX11::DoSetClientSize(width, height);
|
wxWindowX11::DoSetClientSize(width, height);
|
||||||
|
|
||||||
|
#if !wxUSE_NANOX
|
||||||
// Set the top-level window size
|
// Set the top-level window size
|
||||||
XSizeHints size_hints;
|
XSizeHints size_hints;
|
||||||
wxSize oldSize = GetSize();
|
wxSize oldSize = GetSize();
|
||||||
@@ -608,26 +609,6 @@ void wxTopLevelWindowX11::DoSetClientSize(int width, int height)
|
|||||||
wxSize newSize = GetSize();
|
wxSize newSize = GetSize();
|
||||||
wxLogDebug("New size is %d, %d", (int) newSize.x, (int) newSize.y);
|
wxLogDebug("New size is %d, %d", (int) newSize.x, (int) newSize.y);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if 0
|
|
||||||
if (!GetMainWindow())
|
|
||||||
return;
|
|
||||||
|
|
||||||
XWindowChanges windowChanges;
|
|
||||||
int valueMask = 0;
|
|
||||||
|
|
||||||
if (width != -1)
|
|
||||||
{
|
|
||||||
windowChanges.width = width ;
|
|
||||||
valueMask |= CWWidth;
|
|
||||||
}
|
|
||||||
if (height != -1)
|
|
||||||
{
|
|
||||||
windowChanges.height = height ;
|
|
||||||
valueMask |= CWHeight;
|
|
||||||
}
|
|
||||||
XConfigureWindow(wxGlobalDisplay(), (Window) GetMainWindow(),
|
|
||||||
valueMask, & windowChanges);
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -650,7 +631,12 @@ void wxTopLevelWindowX11::DoSetSize(int x, int y, int width, int height, int siz
|
|||||||
// search for the parent that is child of ROOT, because the WM may
|
// search for the parent that is child of ROOT, because the WM may
|
||||||
// reparent twice and notify only the next parent (like FVWM)
|
// reparent twice and notify only the next parent (like FVWM)
|
||||||
while (next_parent != root) {
|
while (next_parent != root) {
|
||||||
Window *theChildren; unsigned int n;
|
Window *theChildren;
|
||||||
|
#if wxUSE_NANOX
|
||||||
|
GR_COUNT n;
|
||||||
|
#else
|
||||||
|
unsigned int n;
|
||||||
|
#endif
|
||||||
parent_window = next_parent;
|
parent_window = next_parent;
|
||||||
XQueryTree(display, parent_window, &root,
|
XQueryTree(display, parent_window, &root,
|
||||||
&next_parent, &theChildren, &n);
|
&next_parent, &theChildren, &n);
|
||||||
@@ -686,6 +672,7 @@ void wxTopLevelWindowX11::DoSetSize(int x, int y, int width, int height, int siz
|
|||||||
|
|
||||||
XConfigureWindow( display, parent_window, valueMask, &windowChanges );
|
XConfigureWindow( display, parent_window, valueMask, &windowChanges );
|
||||||
|
|
||||||
|
#if !wxUSE_NANOX
|
||||||
XSizeHints size_hints;
|
XSizeHints size_hints;
|
||||||
size_hints.flags = 0;
|
size_hints.flags = 0;
|
||||||
if (x > -1 && y > -1)
|
if (x > -1 && y > -1)
|
||||||
@@ -704,62 +691,6 @@ void wxTopLevelWindowX11::DoSetSize(int x, int y, int width, int height, int siz
|
|||||||
// box of the minimal sample probably won't be resized right.
|
// box of the minimal sample probably won't be resized right.
|
||||||
XSync(wxGlobalDisplay(), False);
|
XSync(wxGlobalDisplay(), False);
|
||||||
XSync(wxGlobalDisplay(), False);
|
XSync(wxGlobalDisplay(), False);
|
||||||
|
|
||||||
#if 0
|
|
||||||
wxLogDebug("DoSetSize: Tried to set size to %d, %d", (int) size_hints.width, (int) size_hints.height);
|
|
||||||
|
|
||||||
XSync(wxGlobalDisplay(), False);
|
|
||||||
wxSize newSize = GetSize();
|
|
||||||
wxLogDebug("New size is %d, %d", (int) newSize.x, (int) newSize.y);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
wxPoint pt = GetPosition();
|
|
||||||
// wxLogDebug( "After, pos: %d, %d", pt.x, pt.y );
|
|
||||||
|
|
||||||
XSync(wxGlobalDisplay(), False);
|
|
||||||
int w, h;
|
|
||||||
GetSize(& w, & h);
|
|
||||||
wxString msg;
|
|
||||||
msg.Printf("Before setting size: %d, %d", w, h);
|
|
||||||
wxLogDebug(msg);
|
|
||||||
if (!GetMainWindow())
|
|
||||||
return;
|
|
||||||
|
|
||||||
XWindowChanges windowChanges;
|
|
||||||
int valueMask = 0;
|
|
||||||
|
|
||||||
if (x != -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE))
|
|
||||||
{
|
|
||||||
int yy = 0;
|
|
||||||
AdjustForParentClientOrigin( x, yy, sizeFlags);
|
|
||||||
windowChanges.x = x;
|
|
||||||
valueMask |= CWX;
|
|
||||||
}
|
|
||||||
if (y != -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE))
|
|
||||||
{
|
|
||||||
int xx = 0;
|
|
||||||
AdjustForParentClientOrigin( xx, y, sizeFlags);
|
|
||||||
windowChanges.y = y;
|
|
||||||
valueMask |= CWY;
|
|
||||||
}
|
|
||||||
if (width != -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE))
|
|
||||||
{
|
|
||||||
windowChanges.width = width /* - m_borderSize*2 */;
|
|
||||||
valueMask |= CWWidth;
|
|
||||||
}
|
|
||||||
if (height != -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE))
|
|
||||||
{
|
|
||||||
windowChanges.height = height /* -m_borderSize*2*/;
|
|
||||||
valueMask |= CWHeight;
|
|
||||||
}
|
|
||||||
|
|
||||||
XConfigureWindow(wxGlobalDisplay(), (Window) GetMainWindow(),
|
|
||||||
valueMask, & windowChanges);
|
|
||||||
XSync(wxGlobalDisplay(), False);
|
|
||||||
GetSize(& w, & h);
|
|
||||||
msg.Printf("Tried to set to %d, %d. After setting size: %d, %d", width, height, w, h);
|
|
||||||
wxLogDebug(msg);
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -778,42 +709,35 @@ void wxTopLevelWindowX11::DoGetPosition(int *x, int *y) const
|
|||||||
// search for the parent that is child of ROOT, because the WM may
|
// search for the parent that is child of ROOT, because the WM may
|
||||||
// reparent twice and notify only the next parent (like FVWM)
|
// reparent twice and notify only the next parent (like FVWM)
|
||||||
while (next_parent != root) {
|
while (next_parent != root) {
|
||||||
Window *theChildren; unsigned int n;
|
Window *theChildren;
|
||||||
|
#if wxUSE_NANOX
|
||||||
|
GR_COUNT n;
|
||||||
|
#else
|
||||||
|
unsigned int n;
|
||||||
|
#endif
|
||||||
parent_window = next_parent;
|
parent_window = next_parent;
|
||||||
XQueryTree(display, parent_window, &root,
|
XQueryTree(display, parent_window, &root,
|
||||||
&next_parent, &theChildren, &n);
|
&next_parent, &theChildren, &n);
|
||||||
XFree(theChildren); // not needed
|
XFree(theChildren); // not needed
|
||||||
}
|
}
|
||||||
|
#if 0
|
||||||
int xx, yy; unsigned int dummy;
|
int xx, yy; unsigned int dummy;
|
||||||
XGetGeometry(display, parent_window, &root,
|
XGetGeometry(display, parent_window, &root,
|
||||||
&xx, &yy, &dummy, &dummy, &dummy, &dummy);
|
&xx, &yy, &dummy, &dummy, &dummy, &dummy);
|
||||||
if (x) *x = xx;
|
if (x) *x = xx;
|
||||||
if (y) *y = yy;
|
if (y) *y = yy;
|
||||||
|
#else
|
||||||
#if 0
|
|
||||||
if (window)
|
|
||||||
{
|
|
||||||
int offsetX = 0;
|
|
||||||
int offsetY = 0;
|
|
||||||
|
|
||||||
#if !wxUSE_NANOX
|
|
||||||
// wxLogDebug("Translating...");
|
|
||||||
Window childWindow;
|
|
||||||
XTranslateCoordinates(wxGlobalDisplay(), window, XDefaultRootWindow(wxGlobalDisplay()),
|
|
||||||
0, 0, & offsetX, & offsetY, & childWindow);
|
|
||||||
|
|
||||||
// wxLogDebug("Offset: %d, %d", offsetX, offsetY);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
XWindowAttributes attr;
|
XWindowAttributes attr;
|
||||||
Status status = XGetWindowAttributes(wxGlobalDisplay(), window, & attr);
|
Status status = XGetWindowAttributes((Display*) GetXDisplay(), parent_window, & attr);
|
||||||
wxASSERT(status);
|
|
||||||
|
|
||||||
if (status)
|
if (status)
|
||||||
{
|
{
|
||||||
*x = attr.x + offsetX;
|
if (x) *x = attr.x;
|
||||||
*y = attr.y + offsetY;
|
if (y) *y = attr.y;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (x) *x = 0;
|
||||||
|
if (y) *y = 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user