On Thu 10.Sep'09 at 15:43:26 +0200, Carlos R. Mafra wrote:
> Carlos R. Mafra wrote:
> > So the problem is that it really saves the old geometry, including
> > the fact that it was in the "old" screen before.
> >
> > It is annoying in your case, and it was not happening before so
> > I should try to fix it (although I don't have how to test it myself).
> > I think it could be done by checking whether the un-maximization
> > step is happening in the same screen as the old geometry coordinates,
> > and if not, update the old geometry to point to the new screen (but
> > with the old x and y coords).
>
> I don't know much about the xinerama code and I won't have too much
> free time until I finish my next paper, but I did a quick look
> and it looks like we want to save the old screen pointer too
> in the save_old_geometry(), like
>
> WScreen *old_scr;
> old_scr = wwin->screen_ptr;
>
> and then check for it in wUnmaximizeWindow(), right before the
> comment
>
> /* Use old coordinates if they are set, current values otherwise */
>
> more or less like
>
> if (wwin->screen_ptr != old_scr)
> (move the old geometry to be based on the new screen)
>
> but right now I don't know how to do that with xinerama code.
As it is all my fault I tried to do it quickly along the lines
above, but the attached patch really screws everything here for me
(my windows are not getting the focus anymore).
I don't know if it is because I don't have xinerama here or
if it is something which I am not initializing (like screen_ptr
itself) or if I should stick the screen_ptr in the two other
places where the old_geometry coords are set etc.
diff --git a/src/actions.c b/src/actions.c
index 5217b2b..4371412 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;
@@ -511,6 +512,10 @@ void wUnmaximizeWindow(WWindow * wwin)
wwin->flags.skip_next_animation = 1;
wUnshadeWindow(wwin);
}
+
+ if (wwin->screen_ptr != wwin->old_geometry.screen_ptr)
+ wwin->old_geometry.screen_ptr = wwin->screen_ptr;
+
/* 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;
diff --git a/src/window.h b/src/window.h
index e5ac7f4..f0ceb22 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) */
--
To unsubscribe, send mail to [email protected].