From 371818fe368d8f034c68ca1a93af83cb40b536a8 Mon Sep 17 00:00:00 2001 From: David Maciejak Date: Sat, 23 Aug 2014 19:14:09 +0800 Subject: [PATCH] wmaker: fix deiconify window on double-click This patch is fixing the RenderBadPicture X errors on deiconifying window using double-click. Background: I also experienced this issue these days, after checking it was not introduce with latest apercu feature I decided to dig into it. As far as I saw in the archive it was first reported by Rodolfo in June 2012. Each time a window is deiconify using double-click, the error below is reported in the session error log: 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 So I decided to track when the issue is happening, from src/action.c wDeiconifyWindow then in src/icon.c wIconDestroy then in src/wcore.c wCoreDestroy. At that stage, all the structures I checked are cleaned up properly during the icon destroy process. So I also checked when the issue is generated, I ended in wrlib/xutil.c RCreateXImage (in the share memory extension code) XSync(context->dpy, False); oldErrorHandler = XSetErrorHandler(errorHandler); XShmAttach(context->dpy, &rximg->info); XSync(context->dpy, False); XSetErrorHandler(oldErrorHandler); At this point I was quite lost, cause it means the error could have been in the server error queue already. Facts, seems the issue is appearing only on double-clicking the miniwindow, but not when "Deminiaturize" is clicked from the right-click contextual menu. I also checked the code from winmenu.c when the action MC_MINIATURIZE is selected from execMenuCommand fct, but it was just calling wDeiconifyWindow function. Hum. So, after one full day of thought I tested to just change the focus before double-clicking the miniwindow, and bingo it works. That means when the icon is destroyed the X server still has a reference on it that's generating the issue. --- src/actions.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/actions.c b/src/actions.c index aa88633f..8a78113a 100644 --- a/src/actions.c +++ b/src/actions.c @@ -1324,7 +1324,7 @@ void wDeiconifyWindow(WWindow *wwin) if (!wPreferences.disable_miniwindows && wwin->icon != NULL && !wwin->flags.net_handle_icon) { RemoveFromStackList(wwin->icon->core); - /* removeIconGrabs(wwin->icon); */ + wSetFocusTo(wwin->screen_ptr, wwin); wIconDestroy(wwin->icon); wwin->icon = NULL; } -- 2.11.4.GIT