Skip to content
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

Notifications above lock screen (no compositor) #283

Open
kolayne opened this issue Jul 30, 2023 · 4 comments
Open

Notifications above lock screen (no compositor) #283

kolayne opened this issue Jul 30, 2023 · 4 comments

Comments

@kolayne
Copy link

kolayne commented Jul 30, 2023

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 0da5cdb.

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 :)

@Raymo111
Copy link
Owner

Raymo111 commented Aug 1, 2023

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

@kolayne
Copy link
Author

kolayne commented Aug 1, 2023

i3 version 4.22-35-g754c4f2f

@alexandru0-dev
Copy link

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

@kolayne
Copy link
Author

kolayne commented Aug 4, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants