diff --git a/docs/changes.txt b/docs/changes.txt index a1cbb3d37e..147a420e2f 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -95,8 +95,6 @@ All (GUI): - wxGraphicsContext implementations now all have the pixel's center at (0.5,0.5), avoiding differences in anti-aliasing between platforms. -- Added sizer.desktopmargin.x/y system options so wxSizer::Fit can allow - for decorations. wxMSW: @@ -109,6 +107,8 @@ wxGTK: a background colour bug in the gtk-qt theme under KDE. - wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW) now returns the background colour of text controls. +- Added gtk.desktopmargin.x/y system options to allow windows to fit the desktop + when Xinerama is not available. wxMac: diff --git a/docs/latex/wx/sysopt.tex b/docs/latex/wx/sysopt.tex index 8958d9bd0b..502b957bc6 100644 --- a/docs/latex/wx/sysopt.tex +++ b/docs/latex/wx/sysopt.tex @@ -45,6 +45,8 @@ used if wider fonts selection is more important than higher quality.} \twocolitem{{\bf Option}}{{\bf Value}} \twocolitem{gtk.window.force-background-colour}{If 1, the backgrounds of windows with the wxBG\_STYLE\_COLOUR background style are cleared forcibly instead of relying on the underlying GTK+ window colour. This works around a display problem when running applications under KDE with the gtk-qt theme installed (0.6 and below).} +\twocolitem{sizer.desktopmargin.x}{The horizontal margin to subtract from the desktop size when Xinerama is not available.} +\twocolitem{sizer.desktopmargin.y}{The vertical margin to subtract from the desktop size when Xinerama is not available.} \end{twocollist} \wxheading{Mac} @@ -80,15 +82,6 @@ A reasonable default is used if not specified.} \twocolitem{motif.largebuttons}{If 1, uses a bigger default size for wxButtons.} \end{twocollist} -\wxheading{All} - -\twocolwidtha{7cm} -\begin{twocollist}\itemsep=0pt -\twocolitem{{\bf Option}}{{\bf Value}} -\twocolitem{sizer.desktopmargin.x}{The horizontal margin to subtract from the desktop size when computing the maximum top-level window size in wxSizer::Fit.} -\twocolitem{sizer.desktopmargin.y}{The vertical margin to subtract from the desktop size when computing the maximum top-level window size in wxSizer::Fit.} -\end{twocollist} - The compile-time option to include or exclude this functionality is wxUSE\_SYSTEM\_OPTIONS. diff --git a/src/common/sizer.cpp b/src/common/sizer.cpp index 2a4581396a..c4ea7ad458 100644 --- a/src/common/sizer.cpp +++ b/src/common/sizer.cpp @@ -31,10 +31,6 @@ #include "wx/toplevel.h" #endif // WX_PRECOMP -#if wxUSE_SYSTEM_OPTIONS -#include "wx/sysopt.h" -#endif - #include "wx/listimpl.cpp" #if WXWIN_COMPATIBILITY_2_4 @@ -796,13 +792,6 @@ wxSize wxSizer::Fit( wxWindow *window ) } sizeMax = wxDisplay(disp).GetClientArea().GetSize(); - -#if wxUSE_SYSTEM_OPTIONS - int marginX = wxSystemOptions::GetOptionInt(wxT("sizer.desktopmargin.x")); - int marginY = wxSystemOptions::GetOptionInt(wxT("sizer.desktopmargin.y")); - sizeMax.x -= marginX; - sizeMax.y -= marginY; -#endif } } diff --git a/src/gtk/utilsgtk.cpp b/src/gtk/utilsgtk.cpp index c07fc6170d..9c4934db37 100644 --- a/src/gtk/utilsgtk.cpp +++ b/src/gtk/utilsgtk.cpp @@ -18,10 +18,9 @@ #include "wx/log.h" #endif +#include "wx/sysopt.h" #include "wx/apptrait.h" - #include "wx/process.h" - #include "wx/unix/execute.h" #ifdef __WXDEBUG__ @@ -140,8 +139,11 @@ void *wxGetDisplay() void wxDisplaySize( int *width, int *height ) { - if (width) *width = gdk_screen_width(); - if (height) *height = gdk_screen_height(); + int marginX = wxSystemOptions::GetOptionInt(wxT("gtk.desktopmargin.x")); + int marginY = wxSystemOptions::GetOptionInt(wxT("gtk.desktopmargin.y")); + + if (width) *width = gdk_screen_width() - marginX; + if (height) *height = gdk_screen_height() - marginY; } void wxDisplaySizeMM( int *width, int *height )