i3lock-color icon indicating copy to clipboard operation
i3lock-color copied to clipboard

Notifications above lock screen (no compositor)

Open kolayne opened this issue 11 months ago • 4 comments

This issue is a....

[X] Bug
[ ] Other kind of issue (Please describe in detail)

Current Behavior

When various kinds of notifications (e.g. Telegram Desktop, notify-send) arrive with screen locked, they appear on top of the locked screen (with no compositor running).

Expected Behavior

Notifications are not displayed when the screen is locked

Reproduction Instructions

In bash, run sleep 1 && notify-send hey there & i3lock. The notification will appear on screen.

Environment

Output of i3lock --version:

i3lock version: 2.13.c.5

Reproducible in:

[X] AUR package (https://aur.archlinux.org/packages/i3lock-color)
[X] Built from source yourself
[ ] Other (Please describe in detail)

More information

Bisect has shown that the issue has appeared in 0da5cdb4.

Dumb experiments have shown that the following patch (to the current master version) fixes the notifications problem but, unfortunately, makes everything else other than the background color invisible:

diff --git a/xcb.c b/xcb.c
index ae462b0..2af94d4 100644
--- a/xcb.c
+++ b/xcb.c
@@ -183,9 +183,11 @@ xcb_window_t open_fullscreen_window(xcb_connection_t *conn, xcb_screen_t *scr, c
     }
 
 
+    /*
     xcb_visualid_t visual = get_visualtype_by_depth(32, scr)->visual_id;
     xcb_colormap_t win_colormap = xcb_generate_id(conn);
     xcb_create_colormap(conn, XCB_COLORMAP_ALLOC_NONE, win_colormap, scr->root, visual);
+    */
 
     mask |= XCB_CW_BACK_PIXEL;
     values[0] = get_colorpixel(color);
@@ -203,11 +205,13 @@ xcb_window_t open_fullscreen_window(xcb_connection_t *conn, xcb_screen_t *scr, c
                 XCB_EVENT_MASK_VISIBILITY_CHANGE |
                 XCB_EVENT_MASK_STRUCTURE_NOTIFY;
 
+    /*
     mask |= XCB_CW_COLORMAP;
     values[4] = win_colormap;
+    */
 
     xcb_create_window(conn,
-                      32,
+                      XCB_COPY_FROM_PARENT,
                       win, /* the window id */
                       parent_win,
                       0, 0,
@@ -215,7 +219,7 @@ xcb_window_t open_fullscreen_window(xcb_connection_t *conn, xcb_screen_t *scr, c
                       scr->height_in_pixels, /* dimensions */
                       0,                     /* border = 0, we draw our own */
                       XCB_WINDOW_CLASS_INPUT_OUTPUT,
-                      visual, /* copy visual from parent */
+                      XCB_WINDOW_CLASS_COPY_FROM_PARENT, /* copy visual from parent */
                       mask,
                       values);

As I have no experience with xorg/xcb programming, I have no idea what I'm doing, so, help is much appreciated :)

kolayne avatar Jul 30 '23 16:07 kolayne

Interestingly, I can't repro this on KDE. Which WM/DE are you using?

Raymo111 avatar Aug 01 '23 05:08 Raymo111

i3 version 4.22-35-g754c4f2f

kolayne avatar Aug 01 '23 07:08 kolayne

i use also i3 v4.22 and also i experience this

alexandru0-dev avatar Aug 04 '23 11:08 alexandru0-dev

Btw, the issue is reproducible without a window manager. For instance, in xorg started with startx (as in xorg-xinit) and the screen locked with i3lock (i3lock-color, no additional options) notifications from notify-send appear on top of it

kolayne avatar Aug 04 '23 13:08 kolayne