Fix wxGetClientDisplayRect() when _NET_WORKAREA is not supported.

Don't intersect the total rectangle with the uninitialized work area one
resulting in an empty rectangle being returned from wxGetClientDisplayRect()
if X11 server doesn't support _NET_WORKAREA (this is the case for at least
Cygwin X11 server).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76434 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2014-04-30 14:11:01 +00:00
parent 617e17b746
commit 2fbda42aed

View File

@ -56,11 +56,12 @@ wx_gdk_screen_get_monitor_workarea(GdkScreen* screen, int monitor, GdkRectangle*
if (GDK_IS_X11_SCREEN(screen))
#endif
{
GdkRectangle rect;
GdkRectangle rect = { 0 };
wxGetWorkAreaX11(GDK_SCREEN_XSCREEN(screen),
rect.x, rect.y, rect.width, rect.height);
// in case _NET_WORKAREA result is too large
gdk_rectangle_intersect(dest, &rect, dest);
if (rect.width && rect.height)
gdk_rectangle_intersect(dest, &rect, dest);
}
#endif // GDK_WINDOWING_X11
}