Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Thaodan:X11:windowmanagers
i3
0002-Handle-windows-with-_NET_WM_STATE_STAYS_ON...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0002-Handle-windows-with-_NET_WM_STATE_STAYS_ON_TOP-windo.patch of Package i3
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Daniel Selinger <daniel@slite.org> Date: Sat, 30 Aug 2014 13:48:46 +0200 Subject: [PATCH] Handle windows with _NET_WM_STATE_STAYS_ON_TOP window state such as popups MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Popups for example from knotify, krunner, networkmanager, panel configuration and alike Co-authored-by: Marius Muja <mariusm@cs.ubc.ca> Co-authored-by: Björn Bidar <bjorn.bidar@thaodan.de> --- include/i3-atoms_NET_SUPPORTED.xmacro.h | 3 ++- src/manage.c | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/include/i3-atoms_NET_SUPPORTED.xmacro.h b/include/i3-atoms_NET_SUPPORTED.xmacro.h index cfd850e8972d4d60938088ea6b2cce7a064923bb..d84e37633d0a83f30537c1aa2a84e417aa47f104 100644 --- a/include/i3-atoms_NET_SUPPORTED.xmacro.h +++ b/include/i3-atoms_NET_SUPPORTED.xmacro.h @@ -35,4 +35,5 @@ xmacro(_NET_DESKTOP_VIEWPORT) \ xmacro(_NET_ACTIVE_WINDOW) \ xmacro(_NET_CLOSE_WINDOW) \ xmacro(_NET_MOVERESIZE_WINDOW) \ -xmacro(_NET_WM_WINDOW_TYPE_DESKTOP) +xmacro(_NET_WM_WINDOW_TYPE_DESKTOP) \ +xmacro(_NET_WM_STATE_STAYS_ON_TOP) diff --git a/src/manage.c b/src/manage.c index 03ad4197383d2fd781d687c5d35c6cf1653c2c4b..cffd3e93603db471e2aa5fcce4e6c04c3a26610e 100644 --- a/src/manage.c +++ b/src/manage.c @@ -245,6 +245,18 @@ void manage_window(xcb_window_t window, xcb_get_window_attributes_cookie_t cooki /* Where to start searching for a container that swallows the new one? */ Con *search_at = croot; + bool haswm_type_ontop = false; + bool haswm_type_dock = false; + if (xcb_reply_contains_atom(state_reply, A__NET_WM_STATE_STAYS_ON_TOP)) { + /* this is a window like for example a popup */ + haswm_type_ontop = true; + if (xcb_reply_contains_atom(type_reply, A__NET_WM_WINDOW_TYPE_DOCK)) { + /* kde _NET_WM_STATE_STAYS_ON_TOP often are + _NET_WM_WINDOW_TYPE_DOCK while in reality they dont behave as docks */ + haswm_type_dock = true; + } + } + /* Ignore DESKTOP windows and move them to the bottom of the stack. */ if (xcb_reply_contains_atom(type_reply, A__NET_WM_WINDOW_TYPE_DESKTOP)) { LOG("Ignoring window of type desktop\n"); @@ -523,6 +535,18 @@ void manage_window(xcb_window_t window, xcb_get_window_attributes_cookie_t cooki if (nc->geometry.width == 0) nc->geometry = (Rect){geom->x, geom->y, geom->width, geom->height}; + + if (haswm_type_ontop) { + /* we always want to _NET_WM_STATE_STAYS_ON_TOP be floating with no border */ + nc->border_style = BS_NONE; + nc->border_width = 0; + /* pass false otherwise floating_enable will reset our border to the default + from the config */ + floating_enable(nc, false); + /* we dont need to try to float this again */ + want_floating = false; + } + if (want_floating) { DLOG("geometry = %d x %d\n", nc->geometry.width, nc->geometry.height); if (floating_enable(nc, true)) {
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor