>From e1e12067794c4e53064e59edc3de7af196179369 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?"Rodolfo=20Garc=C3=ADa=20Pe=C3=B1as=20(kix)"?= <[email protected]>
Date: Sat, 23 Jun 2012 15:21:24 +0200
Subject: [PATCH] Test environment

Hi,

we have a bug with stacking. If you check your logfile (~/.xsessions-errors) or 
the console y you are not using a visual login program (xdm, kdm, gdm,...), you 
will find something like:

wmaker(catchXError(startup.c:177)): warning: internal X error: RenderBadPicture 
(invalid Picture parameter)
        Request code: 152
        Request minor code: 7
        Resource ID: 0x6000a4
        Error serial: 9269

This output is created when you deminiaturize a window using double-click. Yes, 
try now! :-)

I spent some time on this problem, but I cannot solve it. I saw an interesting 
thing. When you minimize the window and then deminiaturize with double click 
you get the problem. But, if you minimize the window and then deminiaturize it 
with rigth click on the icon, and then click on deminiaturize, then you don't 
get the error.

Ok, I continue checking the problem, and I created a "Testing enviroment patch" 
(attached). With this patch, I got this output:

--win 0x1a12dd0--
1
2
5
wmaker(catchXError(startup.c:177)): warning: internal X error: RenderBadPicture 
(invalid Picture parameter)
        Request code: 152
        Request minor code: 7
        Resource ID: 0x6000a4
        Error serial: 9269

--win 0x1a499b0--
-.win 0x1a12dd0.-
2
5
-.win 0x1a12dd0.-


When I deminiaturize the icon using double click, then "if 
(frame->stacking->under)" is true, but using the miniwindow menu, the flow is 
different, and it don't exec the stacking line 
"frame->stacking->under->stacking->above = frame->stacking->above;".

The question is easy, why the "frame->stacking->under" exists if I did double 
click?

Finally, if you see the lines above and below the call to wDeiconifyWindow 
(printf("--win %p--\n" and printf("-.win %p.-\n", the WWindow address is the 
same using the menu and different using double click.

Any help is appreciated.

Best Regars,
kix.

---
 src/actions.c  |    1 -
 src/icon.c     |    2 ++
 src/stacking.c |   14 +++++++++++---
 src/winmenu.c  |    2 ++
 4 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/src/actions.c b/src/actions.c
index fed1c1e..6d8ae0d 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -1277,7 +1277,6 @@ void wDeiconifyWindow(WWindow *wwin)
        if (!wPreferences.disable_miniwindows && wwin->icon != NULL
            && !wwin->flags.net_handle_icon) {
                RemoveFromStackList(wwin->icon->core);
-               /*    removeIconGrabs(wwin->icon); */
                wIconDestroy(wwin->icon);
                wwin->icon = NULL;
        }
diff --git a/src/icon.c b/src/icon.c
index fd9bb11..c983950 100644
--- a/src/icon.c
+++ b/src/icon.c
@@ -812,7 +812,9 @@ static void miniwindowDblClick(WObjDescriptor * desc, 
XEvent * event)
 
        assert(icon->owner != NULL);
 
+       printf("--win %p--\n", icon->owner);
        wDeiconifyWindow(icon->owner);
+       printf("--win %p--\n", icon->owner);
 }
 
 static void miniwindowMouseDown(WObjDescriptor * desc, XEvent * event)
diff --git a/src/stacking.c b/src/stacking.c
index 890e4d1..819246f 100644
--- a/src/stacking.c
+++ b/src/stacking.c
@@ -568,16 +568,24 @@ void RemoveFromStackList(WCoreWindow * frame)
                return;
        }
        /* remove from the window stack list */
-       if (frame->stacking->under)
+       if (frame->stacking->under) {
+               printf("1\n");
                frame->stacking->under->stacking->above = 
frame->stacking->above;
-       if (frame->stacking->above)
+       }
+
+       if (frame->stacking->above) {
+               printf("2\n");
                frame->stacking->above->stacking->under = 
frame->stacking->under;
-       else                    /* this was the first window on the list */
+       } else {                        /* this was the first window on the 
list */
+               printf("3\n");
                WMSetInBag(frame->screen_ptr->stacking_list, index, 
frame->stacking->under);
+               printf("4\n");
+       }
 
        frame->screen_ptr->window_count--;
 
        WMPostNotificationName(WMNResetStacking, frame->screen_ptr, NULL);
+       printf("5\n");
 }
 
 void ChangeStackingLevel(WCoreWindow * frame, int new_level)
diff --git a/src/winmenu.c b/src/winmenu.c
index 16a2d31..7a41008 100644
--- a/src/winmenu.c
+++ b/src/winmenu.c
@@ -129,7 +129,9 @@ static void execMenuCommand(WMenu * menu, WMenuEntry * 
entry)
 
        case MC_MINIATURIZE:
                if (wwin->flags.miniaturized) {
+                       printf("-.win %p.-\n", wwin);
                        wDeiconifyWindow(wwin);
+                       printf("-.win %p.-\n", wwin);
                } else {
                        if (wwin->protocols.MINIATURIZE_WINDOW) {
                                wClientSendProtocol(wwin, 
_XA_GNUSTEP_WM_MINIATURIZE_WINDOW, LastTimestamp);
-- 
1.7.10

-- 
||// //\\// Rodolfo "kix" Garcia
||\\// //\\ http://www.kix.es/
>From e1e12067794c4e53064e59edc3de7af196179369 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?"Rodolfo=20Garc=C3=ADa=20Pe=C3=B1as=20(kix)"?= <[email protected]>
Date: Sat, 23 Jun 2012 15:21:24 +0200
Subject: [PATCH] Test environment

---
 src/actions.c  |    1 -
 src/icon.c     |    2 ++
 src/stacking.c |   14 +++++++++++---
 src/winmenu.c  |    2 ++
 4 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/src/actions.c b/src/actions.c
index fed1c1e..6d8ae0d 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -1277,7 +1277,6 @@ void wDeiconifyWindow(WWindow *wwin)
 	if (!wPreferences.disable_miniwindows && wwin->icon != NULL
 	    && !wwin->flags.net_handle_icon) {
 		RemoveFromStackList(wwin->icon->core);
-		/*    removeIconGrabs(wwin->icon); */
 		wIconDestroy(wwin->icon);
 		wwin->icon = NULL;
 	}
diff --git a/src/icon.c b/src/icon.c
index fd9bb11..c983950 100644
--- a/src/icon.c
+++ b/src/icon.c
@@ -812,7 +812,9 @@ static void miniwindowDblClick(WObjDescriptor * desc, XEvent * event)
 
 	assert(icon->owner != NULL);
 
+	printf("--win %p--\n", icon->owner);
 	wDeiconifyWindow(icon->owner);
+	printf("--win %p--\n", icon->owner);
 }
 
 static void miniwindowMouseDown(WObjDescriptor * desc, XEvent * event)
diff --git a/src/stacking.c b/src/stacking.c
index 890e4d1..819246f 100644
--- a/src/stacking.c
+++ b/src/stacking.c
@@ -568,16 +568,24 @@ void RemoveFromStackList(WCoreWindow * frame)
 		return;
 	}
 	/* remove from the window stack list */
-	if (frame->stacking->under)
+	if (frame->stacking->under) {
+		printf("1\n");
 		frame->stacking->under->stacking->above = frame->stacking->above;
-	if (frame->stacking->above)
+	}
+
+	if (frame->stacking->above) {
+		printf("2\n");
 		frame->stacking->above->stacking->under = frame->stacking->under;
-	else			/* this was the first window on the list */
+	} else {			/* this was the first window on the list */
+		printf("3\n");
 		WMSetInBag(frame->screen_ptr->stacking_list, index, frame->stacking->under);
+		printf("4\n");
+	}
 
 	frame->screen_ptr->window_count--;
 
 	WMPostNotificationName(WMNResetStacking, frame->screen_ptr, NULL);
+	printf("5\n");
 }
 
 void ChangeStackingLevel(WCoreWindow * frame, int new_level)
diff --git a/src/winmenu.c b/src/winmenu.c
index 16a2d31..7a41008 100644
--- a/src/winmenu.c
+++ b/src/winmenu.c
@@ -129,7 +129,9 @@ static void execMenuCommand(WMenu * menu, WMenuEntry * entry)
 
 	case MC_MINIATURIZE:
 		if (wwin->flags.miniaturized) {
+			printf("-.win %p.-\n", wwin);
 			wDeiconifyWindow(wwin);
+			printf("-.win %p.-\n", wwin);
 		} else {
 			if (wwin->protocols.MINIATURIZE_WINDOW) {
 				wClientSendProtocol(wwin, _XA_GNUSTEP_WM_MINIATURIZE_WINDOW, LastTimestamp);
-- 
1.7.10

Reply via email to