xwinwm/src Window.cc,1.1.1.1,1.2 blackbox.cc.in,1.1.1.1,1.2

Kensuke Matsuzaki xserver-commit at pdx.freedesktop.org
Tue Apr 13 09:54:52 PDT 2004


Committed by: zakki

Update of /cvs/xserver/xwinwm/src
In directory pdx:/tmp/cvs-serv25547

Modified Files:
	Window.cc blackbox.cc.in 
Log Message:
Fix maximize window. Bring new window to foreground.


Index: Window.cc
===================================================================
RCS file: /cvs/xserver/xwinwm/src/Window.cc,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- a/Window.cc	11 Apr 2004 03:23:44 -0000	1.1.1.1
+++ b/Window.cc	13 Apr 2004 16:54:49 -0000	1.2
@@ -1289,7 +1289,7 @@
                NoEventMask, &ce);
     XFlush(blackbox->getXDisplay());
   }
-  //SetForegroundWindow((HWND)getHWnd(client.window));
+  SetForegroundWindow((HWND)getHWnd(client.window));
 
   return ret;
 }
@@ -2106,7 +2106,7 @@
 #endif
 }
 
-
+//FIXME:
 void BlackboxWindow::configureRequestEvent(const XConfigureRequestEvent *cr) {
   if (cr->window == client.window && !flags.iconic) {
 #if defined(DEBUG)
@@ -2118,13 +2118,37 @@
             frame.rectFrame.right(),
             frame.rectFrame.bottom());
 #endif
-    
+
     if (cr->value_mask & CWBorderWidth)
       client.old_bw = cr->border_width;
-    
+
     if (cr->value_mask & (CWX | CWY | CWWidth | CWHeight)) {
+
+      //Don't touch window size and position, if window is maximized. It restores window.
+      if (flags.maximized)
+        {
+#if defined(DEBUG)
+          fprintf(stderr, "configureRequestEvent - maximized");
+#endif
+          short fx, fy, fw, fh;
+          XWindowsWMFrameGetRect(blackbox->getXDisplay(),
+                                 frame_style, frame_style_ex, 0,
+                                 cr->x, cr->y, cr->width, cr->height,
+                                 &fx, &fy, &fw, &fh);
+          frame.rectFrame.setRect(fx, fy, fw, fh);
+
+          XWindowChanges wc;
+          wc.x = cr->x;
+          wc.y = cr->y;
+          wc.width = cr->width;
+          wc.height = cr->height;
+
+          XConfigureWindow (blackbox->getXDisplay(), client.window,
+                            cr->value_mask & (CWX|CWY|CWWidth|CWHeight), &wc);
+          return;
+        }
       Rect req = frame.rectFrame;
-      
+
       if (cr->value_mask & (CWX | CWY)) {
         if (cr->value_mask & CWX)
           client.rect.setX(cr->x);
@@ -2149,14 +2173,14 @@
       }
 
       if (cr->value_mask & CWWidth)
-        req.setWidth(cr->width/* + frame.margin.left + frame.margin.right*/);
+        req.setWidth(cr->width + frame.margin.left + frame.margin.right);
 
       if (cr->value_mask & CWHeight)
-        req.setHeight(cr->height/* + frame.margin.top + frame.margin.bottom*/);
+        req.setHeight(cr->height + frame.margin.top + frame.margin.bottom);
 
       //      if (!flags.maximized)
-      //configure(req.x(), req.y(), req.width(), req.height());
-
+      configure(req.x(), req.y(), req.width(), req.height());
+#if 0
       XWindowChanges wc;
       wc.x = cr->x;
       wc.y = cr->y;
@@ -2165,6 +2189,7 @@
 
       XConfigureWindow (blackbox->getXDisplay(), client.window,
                         cr->value_mask & (CWX|CWY|CWWidth|CWHeight), &wc);
+#endif
     }
     if (cr->value_mask & CWStackMode) {
 #if 0
@@ -2219,7 +2244,7 @@
 void BlackboxWindow::configureNotifyEvent(const XConfigureEvent *ce) {
   if (ce->window != client.window)
     return;
-#if 1
+#if 0
 #if defined(DEBUG)
   fprintf(stderr, "BlackboxWindow::configureNotifyEvent\n");
 #endif

Index: blackbox.cc.in
===================================================================
RCS file: /cvs/xserver/xwinwm/src/blackbox.cc.in,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- a/blackbox.cc.in	11 Apr 2004 03:23:44 -0000	1.1.1.1
+++ b/blackbox.cc.in	13 Apr 2004 16:54:49 -0000	1.2
@@ -1024,7 +1024,8 @@
 
 void Blackbox::load_rc(BScreen *screen) {
   screen->saveFullMax(False);
-  screen->saveFocusNew(False);
+  //screen->saveFocusNew(False);
+  screen->saveFocusNew(True);
   screen->saveFocusLast(False);
   screen->saveAllowScrollLock(False);
   screen->saveRowPlacementDirection(BScreen::LeftRight);




More information about the xserver-commit mailing list