Code Monkey home page Code Monkey logo

Comments (16)

elParaguayo avatar elParaguayo commented on June 9, 2024

Can you post an xprop of the notification window.

Please also confirm what the desired behaviour should be.

from qtile.

nazar-pc avatar nazar-pc commented on June 9, 2024

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.

elParaguayo avatar elParaguayo commented on June 9, 2024

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.

nazar-pc avatar nazar-pc commented on June 9, 2024

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.

nazar-pc avatar nazar-pc commented on June 9, 2024

Any other information I can provide? I'd really like to fix this somehow.

from qtile.

tych0 avatar tych0 commented on June 9, 2024

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.

elParaguayo avatar elParaguayo commented on June 9, 2024

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.

tych0 avatar tych0 commented on June 9, 2024

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.

nazar-pc avatar nazar-pc commented on June 9, 2024

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.

tych0 avatar tych0 commented on June 9, 2024

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.

elParaguayo avatar elParaguayo commented on June 9, 2024

Should Firefox be setting the override-redirect attribute here? Would that solve the issue?

from qtile.

elParaguayo avatar elParaguayo commented on June 9, 2024

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.

nazar-pc avatar nazar-pc commented on June 9, 2024

Will it still capture focus in that case though?

from qtile.

elParaguayo avatar elParaguayo commented on June 9, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.