Author: manolo
Date: 2011-05-29 11:01:17 -0700 (Sun, 29 May 2011)
New Revision: 8756
Log:
Fix for STR #2648 continued: Fl_Window::decorated_w() and 
Fl_Window::decorated_h() are
also involved in this fix. 

Modified:
   branches/branch-1.3/src/Fl_x.cxx

Modified: branches/branch-1.3/src/Fl_x.cxx
===================================================================
--- branches/branch-1.3/src/Fl_x.cxx    2011-05-29 17:59:39 UTC (rev 8755)
+++ branches/branch-1.3/src/Fl_x.cxx    2011-05-29 18:01:17 UTC (rev 8756)
@@ -1977,6 +1977,9 @@
   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 @@
   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 @@
   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);

_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit

Reply via email to