Revision: 5002
          http://tigervnc.svn.sourceforge.net/tigervnc/?rev=5002&view=rev
Author:   ossman_
Date:     2012-10-03 12:21:54 +0000 (Wed, 03 Oct 2012)
Log Message:
-----------
XFCE's window manager did not interact well with the code that avoided
accidental legacy full screen requests. Seems we need to sort that
FIXME out sooner rather than later.

Modified Paths:
--------------
    trunk/vncviewer/DesktopWindow.cxx

Modified: trunk/vncviewer/DesktopWindow.cxx
===================================================================
--- trunk/vncviewer/DesktopWindow.cxx   2012-10-02 14:45:10 UTC (rev 5001)
+++ trunk/vncviewer/DesktopWindow.cxx   2012-10-03 12:21:54 UTC (rev 5002)
@@ -281,26 +281,35 @@
 #if ! (defined(WIN32) || defined(__APPLE__))
   // X11 window managers will treat a resize to cover the entire
   // monitor as a request to go full screen. Make sure we avoid this.
-  //
-  // FIXME: If this is an external event then this code will get
-  //        FLTK into a confused state about the window's position/size.
-  //        Unfortunately FLTK doesn't offer an easy way to tell
-  //        what kind of resize it is. Let's hope this corner case
-  //        isn't too common...
 #ifdef HAVE_FLTK_FULLSCREEN
   if (!fullscreen_active())
 #endif
   {
-    for (int i = 0;i < Fl::screen_count();i++) {
-      int sx, sy, sw, sh;
+    // Get the real window coordinates, so we can determine if
+    // this is a request to resize, or a notification of a resize
+    // from the X server.
+    XWindowAttributes actual;
+    Window cr;
+    int wx, wy;
 
-      Fl::screen_xywh(sx, sy, sw, sh, i);
+    XGetWindowAttributes(fl_display, fl_xid(this), &actual);
+    XTranslateCoordinates(fl_display, fl_xid(this), actual.root,
+                          0, 0, &wx, &wy, &cr);
 
-      if ((sx == x) && (sy == y) && (sw == w) && (sh == h)) {
-        vlog.info("Adjusting window size to avoid accidental full screen 
request");
-        // Assume a panel of some form and adjust the height
-        y += 20;
-        h -= 40;
+    // Actual resize request?
+    if ((wx != x) || (wy != y) ||
+        (actual.width != w) || (actual.height != h)) {
+      for (int i = 0;i < Fl::screen_count();i++) {
+        int sx, sy, sw, sh;
+
+        Fl::screen_xywh(sx, sy, sw, sh, i);
+
+        if ((sx == x) && (sy == y) && (sw == w) && (sh == h)) {
+          vlog.info("Adjusting window size to avoid accidental full screen 
request");
+          // Assume a panel of some form and adjust the height
+          y += 20;
+          h -= 40;
+        }
       }
     }
   }

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
Tigervnc-commits mailing list
Tigervnc-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tigervnc-commits

Reply via email to