Skip to content

Commit 82634df

Browse files
committed
Merge remote-tracking branch 'origin/pr/163'
* origin/pr/163: Assure Popup Windows (override-redirect) open over parent
2 parents a993c9d + 3a59811 commit 82634df

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
*.dep
33
tags
44
pkgs/
5+
gui-daemon/qubes-guid

gui-daemon/xside.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3364,8 +3364,8 @@ static bool should_keep_on_top(Ghandles *g, Window window) {
33643364

33653365

33663366
/* Move a newly mapped override_redirect window below windows that need to be
3367-
* kept on top, i.e. screen lockers. */
3368-
static void restack_windows(Ghandles *g, struct windowdata *vm_window)
3367+
* kept on top, i.e. screen lockers. Returns new index (-1 == top of all) */
3368+
static int restack_windows(Ghandles *g, struct windowdata *vm_window)
33693369
{
33703370
Window root;
33713371
Window parent;
@@ -3379,7 +3379,7 @@ static void restack_windows(Ghandles *g, struct windowdata *vm_window)
33793379

33803380
if (!children_list) {
33813381
fprintf(stderr, "XQueryTree returned an empty list\n");
3382-
return;
3382+
return 0;
33833383
}
33843384

33853385
/* Traverse children_list, looking for bottom-most window that
@@ -3415,6 +3415,7 @@ static void restack_windows(Ghandles *g, struct windowdata *vm_window)
34153415
}
34163416

34173417
XFree(children_list);
3418+
return goal_pos;
34183419
}
34193420

34203421

@@ -3473,7 +3474,12 @@ static void handle_map(Ghandles * g, struct windowdata *vm_window)
34733474
(void) XMapWindow(g->display, vm_window->local_winid);
34743475

34753476
if (vm_window->override_redirect) {
3476-
restack_windows(g, vm_window);
3477+
if (restack_windows(g, vm_window) == -1) {
3478+
// Ensure override redirect window is raised after mapping
3479+
// But only if no screensaver is active
3480+
XRaiseWindow(g->display, vm_window->local_winid);
3481+
XFlush(g->display); // Ensure raise takes effect immediately
3482+
}
34773483
}
34783484
}
34793485

0 commit comments

Comments
 (0)