Fix dunst losing on-top status on WM restart
Subscribe to receive window creation events on the root window and raise the window when that happens to ensure dunst is on top. We do not raise the window when another override redirect window is created to avoid being on top of things like screen lockers. Fixes #160
This commit is contained in:
		
							parent
							
								
									43c7078ccc
								
							
						
					
					
						commit
						dffe1e1a5a
					
				
							
								
								
									
										11
									
								
								src/x11/x.c
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								src/x11/x.c
									
									
									
									
									
								
							| @ -225,6 +225,11 @@ gboolean x_mainloop_fd_dispatch(GSource *source, GSourceFunc callback, gpointer | ||||
|                 case FocusOut: | ||||
|                         wake_up(); | ||||
|                         break; | ||||
|                 case CreateNotify: | ||||
|                         if (xctx.win.visible && | ||||
|                             ev.xcreatewindow.override_redirect == 0) | ||||
|                                 XRaiseWindow(xctx.dpy, xctx.win.xwin); | ||||
|                         break; | ||||
|                 case PropertyNotify: | ||||
|                         fullscreen_now = have_fullscreen_window(); | ||||
|                         scr = get_active_screen(); | ||||
| @ -485,10 +490,12 @@ static void x_win_setup(void) | ||||
|                    (unsigned long)((100 - settings.transparency) * | ||||
|                                    (0xffffffff / 100))); | ||||
| 
 | ||||
| 
 | ||||
|         long root_event_mask = SubstructureNotifyMask; | ||||
|         if (settings.f_mode != FOLLOW_NONE) { | ||||
|                 long root_event_mask = FocusChangeMask | PropertyChangeMask; | ||||
|                 XSelectInput(xctx.dpy, root, root_event_mask); | ||||
|                 root_event_mask |= FocusChangeMask | PropertyChangeMask; | ||||
|         } | ||||
|         XSelectInput(xctx.dpy, root, root_event_mask); | ||||
| } | ||||
| 
 | ||||
| /*
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Nikos Tsipinakis
						Nikos Tsipinakis