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

Improve dockapp recognition

On Wed, Sep 15, 2010 at 04:40:52PM +0200, Gilbert wrote:
>
> "." = {NoAppIcon = Yes;};
>   "*" = {NoAppIcon = Yes;};

Oh, I see. It lets you override NoAppIcon generically instead of for
each app.

> Exactly, having 'DockApp' as the class name makes them behave more
> consistently internally. This might be fixed in some other way
> internally, but I couldn't figure it out...

Except it doesn't, the only thing it changes inside wmaker is that it
avoids displaying the name as "DockApp" on the settings window.

A "dockapp" is just an application that sets icon_window in WM_HINTS
(which causes a window to be displayed as the app icon) and
initial_state to WithdrawnState (which causes the main window to not
actually appear when the window is mapped). The class has nothing to do
with it.

The problems I mentioned stem from gtk+ not allowing you to set
initial_state to WithdrawnState. Openbox and fluxbox (and maybe others)
don't take the icon_window into their "slit" unless initial_state is
WithdrawnState, so the whole thing completely fails. Wmaker always uses
the icon_window for the app icon, so that part works fine, but the
"main" app window still flashes onscreen for a split second before the
app can call gdk_window_withdraw(), and wmaker applies SharedAppIcon to
it which winds up screwing up the "Kill" menu option.

That said, I've attached a patch to have wmaker treat any window with
class DockApp as if it had initial_state = WithdrawnState, and hopefully
openbox, fluxbox, and the like will pick up the idea too so gtk+
hacks[1] will no longer be needed. If this patch is accpeted, I'll poke
fluxbox and openbox to suggest the idea to them.

[1] E.g. http://wmudmount.svn.sourceforge.net/viewvc/wmudmount/dock.c?r1=8&r2=7

Subject: [PATCH] Improve dockapp recognition

Dockapps are traditionally recognized by having initial_state =
WithdrawnState in WM_HINTS. But some toolkits (e.g. gtk+) will not allow
setting initial_state in this way. So we offer an alternative: any
window with the res_class portion of WM_CLASS set as "DockApp" will be
treated as if it had initial_state = WithdrawnState.
This commit is contained in:
Brad Jorsch
2010-09-15 12:59:00 -04:00
committed by Carlos R. Mafra
parent 2ba8d2eec9
commit 9318a7f428
3 changed files with 19 additions and 0 deletions

9
NEWS
View File

@@ -65,6 +65,15 @@ your CPU unnecessarily (0 wakeups when idle, instead of 4).
So if you edit the WMRootMenu file by hand (or by using 'wmgenmenu'),
there is no need to restart wmaker for the changes to take effect.
DockApp recognition
-------------------
In addition to applications with only Withdrawn windows, Window Maker
will now treat any application with its WM_CLASS res_class set as
"DockApp". This provides an easy workaround for toolkits like gtk+ that
do not allow creation of windows with the initial_state member of
XWMHints set to WithdrawnState.
--- 0.92.0

View File

@@ -677,6 +677,11 @@ WWindow *wManageWindow(WScreen *scr, Window window)
wwin->wm_gnustep_attr = NULL;
}
if (wwin->wm_class != NULL && strcmp(wwin->wm_class, "DockApp") == 0) {
wwin->flags.is_dockapp = 1;
withdraw = True;
}
wwin->client_leader = PropGetClientLeader(window);
if (wwin->client_leader != None)
wwin->main_window = wwin->client_leader;
@@ -692,6 +697,7 @@ WWindow *wManageWindow(WScreen *scr, Window window)
} else if (wwin->wm_hints->initial_state == WithdrawnState) {
wwin->flags.is_dockapp = 1;
withdraw = True;
}
}
@@ -759,6 +765,9 @@ WWindow *wManageWindow(WScreen *scr, Window window)
}
}
if (wwin->flags.is_dockapp)
WSETUFLAG(wwin, shared_appicon, 0);
if (!withdraw && wwin->main_window && WFLAGP(wwin, shared_appicon)) {
char *buffer, *instance, *class;
WFakeGroupLeader *fPtr;

View File

@@ -261,6 +261,7 @@ typedef struct WWindow {
/* info flags */
unsigned int is_gnustep:1; /* 1 if the window belongs to a GNUstep
app */
unsigned int is_dockapp:1; /* 1 if the window belongs to a DockApp */
unsigned int buttons_dont_fit:1;
unsigned int rebuild_texture:1; /* the window was resized and