summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2011-05-29 18:01:17 +0000
committerManolo Gouy <Manolo>2011-05-29 18:01:17 +0000
commit39998a972c3cb873e2fb29bfc1b9532cac45919e (patch)
tree3b7bb89f8b9fbb8d1ac5e9681b245b60c4db8238
parent84a025b174245cb5bff052dbc6a896eeb67f0d3a (diff)
Fix for STR #2648 continued: Fl_Window::decorated_w() and Fl_Window::decorated_h() are
also involved in this fix. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8756 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--src/Fl_x.cxx11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/Fl_x.cxx b/src/Fl_x.cxx
index dc66f4aeb..2c450d132 100644
--- a/src/Fl_x.cxx
+++ b/src/Fl_x.cxx
@@ -1977,6 +1977,9 @@ int Fl_Window::decorated_h()
Window root, parent, *children;
unsigned n;
XQueryTree(fl_display, i->xid, &root, &parent, &children, &n); if (n) XFree(children);
+ // when compiz is used, root and parent are the same window
+ // and I don't know where to find the window decoration
+ if (root == parent) return h();
XWindowAttributes attributes;
XGetWindowAttributes(fl_display, parent, &attributes);
return attributes.height;
@@ -1988,6 +1991,9 @@ int Fl_Window::decorated_w()
Window root, parent, *children;
unsigned n;
XQueryTree(fl_display, i->xid, &root, &parent, &children, &n); if (n) XFree(children);
+ // when compiz is used, root and parent are the same window
+ // and I don't know where to find the window decoration
+ if (root == parent) return w();
XWindowAttributes attributes;
XGetWindowAttributes(fl_display, parent, &attributes);
return attributes.width;
@@ -2010,8 +2016,9 @@ void Fl_Paged_Device::print_window(Fl_Window *win, int x_offset, int y_offset)
do_it = (XQueryTree(fl_display, fl_window, &root, &parent, &children, &n) != 0 &&
XTranslateCoordinates(fl_display, fl_window, parent, 0, 0, &bx, &bt, &child_win) == True);
if (n) XFree(children);
- // hack to bypass STR #2648: when compiz is used, bt is assigned a very high, misleading value
- if (do_it && bt > 30) do_it = 0;
+ // hack to bypass STR #2648: when compiz is used, root and parent are the same window
+ // and I don't know where to find the window decoration
+ if (do_it && root == parent) do_it = 0;
if (!do_it) {
this->set_current();
this->print_widget(win, x_offset, y_offset);