Do you have any idea about the problem which Martin had about the
old geometry being restored in another head in his xinerama setup?
I am a bit lost why that is happening, and I don't have a xinerama
to test :-(

I don't have an external screen neither to test, but I gave this bug a quick 
look.

Martin, could you please try this?

Thanks,
Nicolas


diff --git a/src/actions.c b/src/actions.c
index 4ddfcd2..2f40443 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -296,6 +296,7 @@ void wUnshadeWindow(WWindow *wwin)
/* Set the old coordinates using the current values */
static void save_old_geometry(WWindow *wwin)
{
+       wwin->old_geometry.screen_ptr = wwin->screen_ptr;
       wwin->old_geometry.width = wwin->client.width;
       wwin->old_geometry.height = wwin->client.height;
       wwin->old_geometry.x = wwin->frame_x;
@@ -503,6 +504,7 @@ static void find_Maximus_geometry(WWindow *wwin, WArea 
usableArea, int *new_x, i
void wUnmaximizeWindow(WWindow * wwin)
{
       int x, y, w, h;
+       Bool same_screen;

       if (!wwin->flags.maximized)
               return;
@@ -512,8 +514,9 @@ void wUnmaximizeWindow(WWindow * wwin)
               wUnshadeWindow(wwin);
       }
       /* Use old coordinates if they are set, current values otherwise */
-       x = wwin->old_geometry.x ? wwin->old_geometry.x : wwin->frame_x;
-       y = wwin->old_geometry.y ? wwin->old_geometry.y : wwin->frame_y;
+       same_screen = (wwin->old_geometry.screen_ptr == wwin->screen_ptr);
+       x = (wwin->old_geometry.x && same_screen) ? wwin->old_geometry.x : 
wwin->frame_x;
+       y = (wwin->old_geometry.y && same_screen) ? wwin->old_geometry.y : 
wwin->frame_y;
       w = wwin->old_geometry.width ? wwin->old_geometry.width : 
wwin->client.width;
       h = wwin->old_geometry.height ? wwin->old_geometry.height : 
wwin->client.height;

diff --git a/src/window.h b/src/window.h
index e5ac7f4..83f6066 100644
--- a/src/window.h
+++ b/src/window.h
@@ -198,6 +198,7 @@ typedef struct WWindow {
    int frame_x, frame_y;             /* position of the frame in root*/

    struct {
+        WScreen *screen_ptr;
        int x, y;
        unsigned int width, height;    /* original geometry of the window */
    } old_geometry;                   /* (before things like maximize) */

Attachment: wmaker_xinerama_maximize.patch.gz
Description: application/gzip

Reply via email to