baskerville / bspwm

A tiling window manager based on binary space partitioning
BSD 2-Clause "Simplified" License
7.71k stars 416 forks source link

GIMP dialogs on top #1295

Open q3cpma opened 3 years ago

q3cpma commented 3 years ago

Hello,

I can't manage for GIMP tool windows (e.g. Color->Curves) to stay on top so I made a modification to bspwm to add the put_dialogs_above option that does as it says (put the windows with _NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_DIALOG in the ABOVE layer). I made this issue because I don't know if there's a way to do it without this patch and if this patch could be interesting to propose.

Said windows' xprop is as follow:

_NET_WM_DESKTOP(CARDINAL) = 0
WM_STATE(WM_STATE):
                window state: Normal
                icon window: 0x0
WM_HINTS(WM_HINTS):
                Client accepts input or input focus: True
                Initial state is Normal State.
                bitmap id # to use for icon: 0x160080b
                bitmap id # of mask for icon: 0x160080c
                window id # of group leader: 0x1600001
XdndAware(ATOM) = BITMAP
_MOTIF_DRAG_RECEIVER_INFO(_MOTIF_DRAG_RECEIVER_INFO) = 0x6c, 0x0, 0x5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0
_NET_WM_ICON(CARDINAL) =        Icon (128 x 128):
        (not shown)

WM_WINDOW_ROLE(STRING) = "gimp-curves-tool"
WM_TRANSIENT_FOR(WINDOW): window id # 0x16000e3
_NET_WM_SYNC_REQUEST_COUNTER(CARDINAL) = 23072240
_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_DIALOG
_NET_WM_USER_TIME(CARDINAL) = 29498792
_NET_WM_USER_TIME_WINDOW(WINDOW): window id # 0x1600def
WM_CLIENT_LEADER(WINDOW): window id # 0x1600001
_NET_WM_PID(CARDINAL) = 9678
WM_LOCALE_NAME(STRING) = "en_US.utf8"
WM_CLIENT_MACHINE(STRING) = "gentoo-zen2700x"
WM_NORMAL_HINTS(WM_SIZE_HINTS):
                user specified location: 0, 0
                program specified location: 0, 0
                program specified minimum size: 373 by 551
                window gravity: NorthWest
WM_PROTOCOLS(ATOM): protocols  WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_SYNC_REQUEST
WM_CLASS(STRING) = "gimp", "Gimp"
WM_ICON_NAME(STRING) = "Curves"
_NET_WM_ICON_NAME(UTF8_STRING) = "Curves"
WM_NAME(STRING) = "Curves"
_NET_WM_NAME(UTF8_STRING) = "Curves"

Using bspwm git on Gentoo with the following config:

#!/bin/sh

bspc monitor -d I II III IV V VI VII VIII IX X

bspc config border_width            1
bspc config window_gap              10
bspc config top_padding 15
bspc config left_padding 0
bspc config bottom_padding 0
bspc config right_padding 0

bspc config click_to_focus            any
bspc config honor_size_hints          true
bspc config ignore_ewmh_focus         true
bspc config put_dialogs_above         true

bspc config normal_border_color       "#aaaaaa"
bspc config active_border_color       "#aaaaaa"
bspc config focused_border_color      "#5555ff"

bspc config pointer_modifier          mod4
bspc config pointer_action1           move
bspc config pointer_action3           resize_corner

bspc config remove_disabled_monitors  true
bspc config remove_unplugged_monitors true

bspc rule -a sfeed                    desktop=^10
bspc rule -a neomutt                  desktop=^10
bspc rule -a crawl:crawl              state=tiled
bspc rule -a flare                    state=floating
bspc rule -a *:floating               state=floating
bspc rule -a floating                 state=floating
bspc rule -a Gimp                     state=floating
bspc rule -a gzdoom                   state=floating
bspc rule -a mpv                      state=floating
bspc rule -a Pinentry                 state=floating
bspc rule -a retroarch                state=floating

~/.config/lemonbar/bar.sh &
Alexander-Shukaev commented 2 years ago

Can you submit a PR please?

q3cpma commented 2 years ago

Oh, and I do have the setting Edit > Preferences > Interface > Window Management > Window Manager Hints set to Keep above. So it's arguably a GIMP "bug" (not really, only ICCCM is required by X11, right?) for not setting _NET_WM_STATE, but I'm sure there are other (perhaps older) applications not filling in EWMH but still using dialogs.