diff options
| author | Po Lu | 2022-02-10 10:21:15 +0800 |
|---|---|---|
| committer | Po Lu | 2022-02-10 10:21:15 +0800 |
| commit | f9a7a81cde41bacd63d280700089cc95490e4bea (patch) | |
| tree | 2b5645b2de63e91b1796185be5801edf372375a5 /src | |
| parent | 8df3052bdb18d000cd1726eabde2b1a30f6b10f0 (diff) | |
| download | emacs-f9a7a81cde41bacd63d280700089cc95490e4bea.tar.gz emacs-f9a7a81cde41bacd63d280700089cc95490e4bea.zip | |
Improve reliability of hotplugging window managers
* src/xterm.c (x_make_frame_visible): Change the user time
window if the window manager supports something different from
what it did the first time the frame was made visible.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xterm.c | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/src/xterm.c b/src/xterm.c index 5b97da36ba1..abfad61041d 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -14534,21 +14534,36 @@ x_make_frame_visible (struct frame *f) | |||
| 14534 | #ifndef USE_GTK | 14534 | #ifndef USE_GTK |
| 14535 | output = FRAME_X_OUTPUT (f); | 14535 | output = FRAME_X_OUTPUT (f); |
| 14536 | 14536 | ||
| 14537 | if (output->user_time_window == None) | 14537 | if (!x_wm_supports (f, dpyinfo->Xatom_net_wm_user_time_window)) |
| 14538 | { | 14538 | { |
| 14539 | XSetWindowAttributes attrs; | 14539 | if (output->user_time_window == None) |
| 14540 | memset (&attrs, 0, sizeof attrs); | 14540 | output->user_time_window = FRAME_OUTER_WINDOW (f); |
| 14541 | 14541 | else if (output->user_time_window != FRAME_OUTER_WINDOW (f)) | |
| 14542 | output->user_time_window | 14542 | { |
| 14543 | = FRAME_OUTER_WINDOW (f); | 14543 | XDestroyWindow (dpyinfo->display, |
| 14544 | 14544 | output->user_time_window); | |
| 14545 | if (x_wm_supports (f, dpyinfo->Xatom_net_wm_user_time_window)) | 14545 | XDeleteProperty (dpyinfo->display, |
| 14546 | FRAME_OUTER_WINDOW (f), | ||
| 14547 | dpyinfo->Xatom_net_wm_user_time_window); | ||
| 14548 | output->user_time_window = FRAME_OUTER_WINDOW (f); | ||
| 14549 | } | ||
| 14550 | } | ||
| 14551 | else | ||
| 14552 | { | ||
| 14553 | if (output->user_time_window == FRAME_OUTER_WINDOW (f) | ||
| 14554 | || output->user_time_window == None) | ||
| 14546 | { | 14555 | { |
| 14556 | XSetWindowAttributes attrs; | ||
| 14557 | memset (&attrs, 0, sizeof attrs); | ||
| 14558 | |||
| 14547 | output->user_time_window | 14559 | output->user_time_window |
| 14548 | = XCreateWindow (dpyinfo->display, FRAME_X_WINDOW (f), | 14560 | = XCreateWindow (dpyinfo->display, FRAME_X_WINDOW (f), |
| 14549 | -1, -1, 1, 1, 0, 0, InputOnly, | 14561 | -1, -1, 1, 1, 0, 0, InputOnly, |
| 14550 | CopyFromParent, 0, &attrs); | 14562 | CopyFromParent, 0, &attrs); |
| 14551 | 14563 | ||
| 14564 | XDeleteProperty (dpyinfo->display, | ||
| 14565 | FRAME_OUTER_WINDOW (f), | ||
| 14566 | dpyinfo->Xatom_net_wm_user_time); | ||
| 14552 | XChangeProperty (dpyinfo->display, | 14567 | XChangeProperty (dpyinfo->display, |
| 14553 | FRAME_OUTER_WINDOW (f), | 14568 | FRAME_OUTER_WINDOW (f), |
| 14554 | dpyinfo->Xatom_net_wm_user_time_window, | 14569 | dpyinfo->Xatom_net_wm_user_time_window, |