Comments (16)
Can you post an xprop of the notification window.
Please also confirm what the desired behaviour should be.
from qtile.
xprop:
_NET_WM_STATE(ATOM) =
_NET_FRAME_EXTENTS(CARDINAL) = 1, 1, 1, 1
_NET_WM_DESKTOP(CARDINAL) = 1
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.
window id # of group leader: 0x3600001
_GTK_THEME_VARIANT(UTF8_STRING) =
_NET_WM_BYPASS_COMPOSITOR(CARDINAL) = 2
WM_WINDOW_ROLE(STRING) = "alert"
XdndAware(ATOM) = BITMAP
_MOTIF_WM_HINTS(_MOTIF_WM_HINTS) = 0x2, 0x0, 0x0, 0x0, 0x0
_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_NOTIFICATION
_NET_WM_SYNC_REQUEST_COUNTER(CARDINAL) = 56623286, 56623287
_NET_WM_USER_TIME(CARDINAL) = 62597
_NET_WM_USER_TIME_WINDOW(WINDOW): window id # 0x36000b5
WM_CLIENT_LEADER(WINDOW): window id # 0x3600001
_NET_WM_PID(CARDINAL) = 9767
WM_LOCALE_NAME(STRING) = "uk_UA.UTF-8"
WM_CLIENT_MACHINE(STRING) = "nazar-pc"
WM_NORMAL_HINTS(WM_SIZE_HINTS):
program specified location: 0, 0
program specified minimum size: 0 by 0
program specified maximum size: 16384 by 16384
program specified base size: 0 by 0
window gravity: NorthWest
WM_PROTOCOLS(ATOM): protocols WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_SYNC_REQUEST
WM_CLASS(STRING) = "Alert", "firefox-nightly"
WM_ICON_NAME(STRING) =
_NET_WM_ICON_NAME(UTF8_STRING) =
WM_NAME(STRING) =
_NET_WM_NAME(UTF8_STRING) =
I expect that this notification will be sticky (remaining in top right corner when I switch groups) and to not steal focus when it opens.
from qtile.
The way we handle notification windows is to make them floating but they shouldn't steal focus. That code was in place back in 0.21.0 too.
When I create a notification window it doesn't steal focus so I'm not sure why this one is.
Our code doesn't make the notification "sticky".
from qtile.
Here is xprop
of the older version of Firefox where notifications are working correctly (do not steal focus, sticky and shown on any group):
WM_HINTS(WM_HINTS):
Client accepts input or input focus: True
Initial state is Normal State.
window id # of group leader: 0x6600001
_NET_WM_BYPASS_COMPOSITOR(CARDINAL) = 2
WM_WINDOW_ROLE(STRING) = "alert"
XdndAware(ATOM) = BITMAP
_NET_WM_OPAQUE_REGION(CARDINAL) =
_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_UTILITY
_NET_WM_SYNC_REQUEST_COUNTER(CARDINAL) = 106954891, 106954892
_NET_WM_USER_TIME(CARDINAL) = 624485161
_NET_WM_USER_TIME_WINDOW(WINDOW): window id # 0x660008a
WM_CLIENT_LEADER(WINDOW): window id # 0x6600001
_NET_WM_PID(CARDINAL) = 2002550
WM_LOCALE_NAME(STRING) = "uk_UA.UTF-8"
WM_CLIENT_MACHINE(STRING) = "nazar-pc"
WM_NORMAL_HINTS(WM_SIZE_HINTS):
program specified location: 0, 0
program specified minimum size: 0 by 0
program specified maximum size: 16384 by 16384
program specified base size: 0 by 0
window gravity: NorthWest
WM_PROTOCOLS(ATOM): protocols WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_SYNC_REQUEST
WM_CLASS(STRING) = "Alert", "firefox-nightly"
WM_ICON_NAME(STRING) =
_NET_WM_ICON_NAME(UTF8_STRING) =
WM_NAME(STRING) =
_NET_WM_NAME(UTF8_STRING) =
from qtile.
Any other information I can provide? I'd really like to fix this somehow.
from qtile.
The only place I can really tell that we treat them differently is below,
diff --git a/libqtile/backend/x11/window.py b/libqtile/backend/x11/window.py
index 2f7fef90..342ee6a1 100644
--- a/libqtile/backend/x11/window.py
+++ b/libqtile/backend/x11/window.py
@@ -1240,7 +1240,7 @@ class _Window:
@property
def can_steal_focus(self):
- return self.window.get_wm_type() != "notification"
+ return self.window.get_wm_type() not in ["notification", "utility"]
def _do_focus(self):
"""
I don't know that we'd want to apply that patch (it may make e.g. gimp windows a bit wonky), but can you confirm whether that matches the behavior you expect?
from qtile.
I was reluctant to change that too.
The broader question seems to be whether we make notification windows static so they appear on every group.
from qtile.
The broader question seems to be whether we make notification windows static so they appear on every group.
Yep, and IMO we don't. Stuff from libnotify is type notification, which means those will show up on every desktop. Perhaps an option to do so but off by default is the best we'd do. (But users can already do this right? they can hook client_new
and make it static there?
from qtile.
I'm not sure if there is a standard for this, but are you saying that Firefox basically switched to incorrect (not appropriate) window type for their notification and they should fix it? I can workaround it on my end, but I am also interested in knowing what is the root cause here and where it should, ideally, be fixed.
from qtile.
They definitely changed it. Whether it's incorrect is a matter of opinion. I believe they've made a correct decision here. If you read https://specifications.freedesktop.org/wm-spec/1.5/ar01s05.html#idm44882398096864 it says of "utility" (i.e. the old style):
_NET_WM_WINDOW_TYPE_UTILITY indicates a small persistent utility window, such as a palette or toolbox. It is distinct from type TOOLBAR because it does not correspond to a toolbar torn off from the main application. It's distinct from type DIALOG because it isn't a transient dialog, the user will probably keep it open while they're working. Windows of this type may set the WM_TRANSIENT_FOR hint indicating the main application window.
and of notification
_NET_WM_WINDOW_TYPE_NOTIFICATION indicates a notification. An example of a notification would be a bubble appearing with informative text such as "Your laptop is running out of power" etc. This property is typically used on override-redirect windows.
IMO, we only want notifications to be displayed on the current desktop, vs. all of them (although, is that the old behavior of utility windows? I don't think so right?).
from qtile.
Should Firefox be setting the override-redirect attribute here? Would that solve the issue?
from qtile.
Ok. I've tested this a bit:
- If I create a window with type
_NET_WM_WINDOW_TYPE_NOTIFICATION
then the window stays on the current group - If do the same and set the override redirect flag then the window is sticky and is visible on every group.
So, it looks like firefox should set that flag (which would be in line with the spec that Tych0 posted above).
from qtile.
Will it still capture focus in that case though?
from qtile.
I don't think so. Once I've done those steps, clicking on the window does not focus the window.
If you want to try it, this is the script I used:
#!/usr/bin/bash
xprop -f _NET_WM_WINDOW_TYPE 32a -set _NET_WM_WINDOW_TYPE _NET_WM_WINDOW_TYPE_NOTIFICATION -id $1
xdotool set_window --overrideredirect 1 $1
xdotool windowunmap $1
xdotool windowmap $1
I run it with the ID of an existing window.
from qtile.
Related Issues (20)
- On a config reload, a custom layout that manages internal windows can face a 'dict changed size during iteration' error
- 0.24.0: test_all_migrations[MatchListRegex-0] is failing HOT 4
- Icons used in cloned LaunchBars do not dynamically change their size when `icon_size` isn't set HOT 1
- Window isn't raised to the top on _NET_ACTIVE_WINDOW request HOT 2
- stale window in x11 layering code HOT 5
- `reconfigure_screens` config and functionality are buggy HOT 4
- Special characters cause MPRIS2 widget to crash HOT 2
- `qtile check` results in `mypy build error`, cannot find `libqtile.config` or `libqtile.layout.base` HOT 4
- TypeError with group focus_by_index CLI command HOT 5
- Qtile screen order isn't matching output of xrandr --listmonitors HOT 20
- MPRIS2 widget crashes qtile due to EOF error HOT 4
- lazy.spawn does not allow env variables with shell=True HOT 2
- Can't keybind groups to digits with azerty keyboards HOT 14
- cannot start wayland with nvidia HOT 1
- qtile freeze when XF86AUDIO key press HOT 4
- Docks cannot maximize windows that are minimized
- libqtile.backend.wayland._ffi is not created when installing from qtile-0.24.0-py3-none-any.whl HOT 9
- Import Error: Bluetooth HOT 2
- libqtile.wayland.Output._on_frame: Skip rendering if commit fails HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qtile.