1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-21 05:18:06 +01:00

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.
This commit is contained in:
David Maciejak
2014-08-23 19:14:09 +08:00
committed by Carlos R. Mafra
parent 238b8ed3ca
commit 371818fe36

View File

@@ -1324,7 +1324,7 @@ void wDeiconifyWindow(WWindow *wwin)
if (!wPreferences.disable_miniwindows && wwin->icon != NULL if (!wPreferences.disable_miniwindows && wwin->icon != NULL
&& !wwin->flags.net_handle_icon) { && !wwin->flags.net_handle_icon) {
RemoveFromStackList(wwin->icon->core); RemoveFromStackList(wwin->icon->core);
/* removeIconGrabs(wwin->icon); */ wSetFocusTo(wwin->screen_ptr, wwin);
wIconDestroy(wwin->icon); wIconDestroy(wwin->icon);
wwin->icon = NULL; wwin->icon = NULL;
} }