-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
background tabs are not background, if tabs are windows #3819
Comments
I think this is a duplicate of #818 (and because of that, an issue in the WM). |
Related patch from the ML: From: Eike Fokken <ef...n@posteo.de>
Date: Fri, 13 Apr 2018 14:06:02 +0200
Subject: [PATCH] Adds the window_role "qutebrowser_background" for background
windows
For some users it may be the desired behaviour that non-background
windows grab focus on creation, but background windows don't. To make
this possible without interfering with window manager settings this
task is left to the window manager. To make it recognize background
windows, they are given a special window role.
For example in i3 one can then set
no_focus [window_role= "qutebrowser_background"]
to disable focus grabbing only for background windows.
---
qutebrowser/mainwindow/tabbedbrowser.py | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/qutebrowser/mainwindow/tabbedbrowser.py b/qutebrowser/mainwindow/tabbedbrowser.py
index ce36f0038..313dfde01 100644
--- a/qutebrowser/mainwindow/tabbedbrowser.py
+++ b/qutebrowser/mainwindow/tabbedbrowser.py
@@ -458,9 +458,14 @@ class TabbedBrowser(QWidget):
"related {}, idx {}".format(
url, background, related, idx))
+ if background is None:
+ background = config.val.tabs.background
+
if (config.val.tabs.tabs_are_windows and self.widget.count() > 0 and
not ignore_tabs_are_windows):
window = mainwindow.MainWindow(private=self.private)
+ if background:
+ window.setWindowRole("qutebrowser_background")
window.show()
tabbed_browser = objreg.get('tabbed-browser', scope='window',
window=window.win_id)
@@ -478,8 +483,6 @@ class TabbedBrowser(QWidget):
if url is not None:
tab.openurl(url)
- if background is None:
- background = config.val.tabs.background
if background:
# Make sure the background tab has the correct initial size.
# With a foreground tab, it's going to be resized correctly by the
--
2.17.0 |
FWIW, ICCM says:
So abusing |
Hi there,
yeah, I definitely should have researched more thoroughly, I'm sorry for
causing work to you!
Now that I looked into it, I stumbled over (on the same page)
If the WM_WINDOW_ROLE property is not specified on a top level window,
a client that needs to uniquely identify that window will try to use
instead the values of WM_CLASS and WM_NAME. If a client has multiple
windows with identical WM_CLASS and WM_NAME properties, then it should
provide a WM_WINDOW_ROLE property.
which qutebrowser doesn't do: I attached the output of xprop on two
browser windows visiting the same webpage and a diff of them. They are
identical as far as WM_CLASS, WM_NAME and WM_WINDOW_ROLE are concerned.
I guess it is a good idea to conform to the standard (this is an actual
guess, I have no experience of writing software that is used by anyone I
don't personally know!) but I don't see that I will do it anytime soon,
because for me (given my inexperience) it would involve a lot of time I
currently don't have. But if it is still not fixed in maybe a year, I
may find the time and then also implement the background window thing,
then maybe as a part of WM_NAME.
Best
Eike
On 06/07/2018 11:53 AM, Florian Bruhin wrote:
FWIW, ICCM says <https://tronche.com/gui/x/icccm/sec-5.html>:
The client must set the WM_WINDOW_ROLE property to a string that
uniquely identifies that window among all windows that have the
same client leader window.
So abusing |setWindowRole| to tell foreground/background windows apart
seems like quite a hack with a possibility to break other things
depending on the window manager.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#3819 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AgRYat66UVgl0Q-S32Gzpi4rXeC81ONxks5t6PgdgaJpZM4TIKrO>.
0a1,7
_NET_WM_STATE(ATOM) =
_NET_WM_DESKTOP(CARDINAL) = 0
WM_STATE(WM_STATE):
window state: Normal
icon window: 0x0
_NET_WM_USER_TIME(CARDINAL) = 13843988
_NET_WM_ICON_NAME(UTF8_STRING) =
36,42d42
< _NET_WM_STATE(ATOM) =
< _NET_WM_DESKTOP(CARDINAL) = 0
< WM_STATE(WM_STATE):
< window state: Normal
< icon window: 0x0
< _NET_WM_USER_TIME(CARDINAL) = 13840508
< _NET_WM_ICON_NAME(UTF8_STRING) =
54c54
< _NET_WM_SYNC_REQUEST_COUNTER(CARDINAL) = 27263543
---
_NET_WM_SYNC_REQUEST_COUNTER(CARDINAL) = 27263647
_NET_WM_ICON(CARDINAL) = Icon (32 x 32):
░░░░░░ ░░░░
░░░▒▒░▒░░ ░ ░░░░░░▒░
░ ▒▓░░░░░░░░ ░░░░░░░▓░░
░▓░░ ░░▓░░
▓▒░ ▓▒░
░ ▓▒ ░ ▒▓▓▒░▒▒▒▓▒ ░ ░▓
░░█ ░▓█▓▓█▒ ░▒▓█▓ ░▓
░░█░ ░░▓█████▓ ▓██▓ ░▓
░░▓░ ░ ▓█▓▒▒▒░░ ░▒▓▓▒░ ░▓
░ ▓░░ ░▓▓ ░ ▓░░ ░▒▒
░ ▓▓░░░▓░ ▒▓ ░░ ░░▒░ ▓▒░░█▒
▒▓▓▒▓▒ ░ ▒ ░ ▒█▓█▓░░
░ ▒▓█▓ ▒▓▒ ▒▓▒ █▓▓ ░
░ ░▒▒ ░▓ ▓░ ▒▒ ░
░░░░ ░ ░░ ░
░ ▓ ░░ ░
▒ ░ ░ ░ ░░░░
░ ░ ▒ ░ ░░
░ ░▒ ░ ░▒▒ ░
▒▒░░ ░ ░ ░
░ ░ ░
░ ░ ░ ░
░ ░░ ░ ░
░ ▒░ ░░░░░▒▓
░ ░░ ░
░ ░▓ ░▒▓▓▒
░ ▒ ░ ░ ░
▒▓▓ ░
▒▒░ ░░░
░▒▓░▒█░
░ ▓▒▓█▓░
▓▓▓█▒
_NET_WM_STATE(ATOM) =
_NET_WM_DESKTOP(CARDINAL) = 0
WM_STATE(WM_STATE):
window state: Normal
icon window: 0x0
_NET_WM_USER_TIME(CARDINAL) = 13840508
_NET_WM_ICON_NAME(UTF8_STRING) =
XdndAware(ATOM) = BITMAP
WM_NAME(STRING) = "The GNU Operating System and the Free Software Movement - qutebrowser"
_NET_WM_NAME(UTF8_STRING) = "The GNU Operating System and the Free Software Movement - qutebrowser"
_MOTIF_WM_HINTS(_MOTIF_WM_HINTS) = 0x3, 0x3e, 0x7e, 0x0, 0x0
_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_NORMAL
_XEMBED_INFO(_XEMBED_INFO) = 0x0, 0x1
WM_CLIENT_LEADER(WINDOW): window id # 0x1a00023
WM_HINTS(WM_HINTS):
Client accepts input or input focus: True
Initial state is Normal State.
_NET_WM_PID(CARDINAL) = 4211
_NET_WM_SYNC_REQUEST_COUNTER(CARDINAL) = 27263543
WM_CLASS(STRING) = "qutebrowser", "qutebrowser"
WM_PROTOCOLS(ATOM): protocols WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_SYNC_REQUEST
WM_NORMAL_HINTS(WM_SIZE_HINTS):
user specified location: 2, 18
user specified size: 1916 by 1041
program specified minimum size: 127 by 44
window gravity: NorthWest
_NET_WM_STATE(ATOM) =
_NET_WM_DESKTOP(CARDINAL) = 0
WM_STATE(WM_STATE):
window state: Normal
icon window: 0x0
_NET_WM_USER_TIME(CARDINAL) = 13843988
_NET_WM_ICON_NAME(UTF8_STRING) =
_NET_WM_ICON(CARDINAL) = Icon (32 x 32):
░░░░░░ ░░░░
░░░▒▒░▒░░ ░ ░░░░░░▒░
░ ▒▓░░░░░░░░ ░░░░░░░▓░░
░▓░░ ░░▓░░
▓▒░ ▓▒░
░ ▓▒ ░ ▒▓▓▒░▒▒▒▓▒ ░ ░▓
░░█ ░▓█▓▓█▒ ░▒▓█▓ ░▓
░░█░ ░░▓█████▓ ▓██▓ ░▓
░░▓░ ░ ▓█▓▒▒▒░░ ░▒▓▓▒░ ░▓
░ ▓░░ ░▓▓ ░ ▓░░ ░▒▒
░ ▓▓░░░▓░ ▒▓ ░░ ░░▒░ ▓▒░░█▒
▒▓▓▒▓▒ ░ ▒ ░ ▒█▓█▓░░
░ ▒▓█▓ ▒▓▒ ▒▓▒ █▓▓ ░
░ ░▒▒ ░▓ ▓░ ▒▒ ░
░░░░ ░ ░░ ░
░ ▓ ░░ ░
▒ ░ ░ ░ ░░░░
░ ░ ▒ ░ ░░
░ ░▒ ░ ░▒▒ ░
▒▒░░ ░ ░ ░
░ ░ ░
░ ░ ░ ░
░ ░░ ░ ░
░ ▒░ ░░░░░▒▓
░ ░░ ░
░ ░▓ ░▒▓▓▒
░ ▒ ░ ░ ░
▒▓▓ ░
▒▒░ ░░░
░▒▓░▒█░
░ ▓▒▓█▓░
▓▓▓█▒
XdndAware(ATOM) = BITMAP
WM_NAME(STRING) = "The GNU Operating System and the Free Software Movement - qutebrowser"
_NET_WM_NAME(UTF8_STRING) = "The GNU Operating System and the Free Software Movement - qutebrowser"
_MOTIF_WM_HINTS(_MOTIF_WM_HINTS) = 0x3, 0x3e, 0x7e, 0x0, 0x0
_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_NORMAL
_XEMBED_INFO(_XEMBED_INFO) = 0x0, 0x1
WM_CLIENT_LEADER(WINDOW): window id # 0x1a00023
WM_HINTS(WM_HINTS):
Client accepts input or input focus: True
Initial state is Normal State.
_NET_WM_PID(CARDINAL) = 4211
_NET_WM_SYNC_REQUEST_COUNTER(CARDINAL) = 27263647
WM_CLASS(STRING) = "qutebrowser", "qutebrowser"
WM_PROTOCOLS(ATOM): protocols WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_SYNC_REQUEST
WM_NORMAL_HINTS(WM_SIZE_HINTS):
user specified location: 2, 18
user specified size: 1916 by 1041
program specified minimum size: 127 by 44
window gravity: NorthWest
|
My settings are
I have these settings:
c.tabs.show = 'never'
c.tabs.tabs_are_windows = True
When I run
:open -b gnu.org
it opens gnu.org in a new window but focuses this new window.
I would like it to keep focus on the current window.
Is this possible from within qutebrowser or is it an issue of the window manager (i3wm)?
The same (and more relevant) happens when I try to open a hint in background tab with
;b
Best
Eike
The text was updated successfully, but these errors were encountered: