Quellcode durchsuchen

Set an always on top atom to tell the window manager to keep slop on top.

naelstrof vor 7 Jahren
Ursprung
Commit
e787f1b15a
2 geänderte Dateien mit 4 neuen und 1 gelöschten Zeilen
  1. 1
    1
      CMakeLists.txt
  2. 3
    0
      src/window.cpp

+ 1
- 1
CMakeLists.txt Datei anzeigen

@@ -21,7 +21,7 @@ endif()
21 21
 
22 22
 include_directories("${PROJECT_BINARY_DIR}")
23 23
 
24
-add_definitions(-DSLOP_VERSION="v5.3.21")
24
+add_definitions(-DSLOP_VERSION="v5.3.23")
25 25
 
26 26
 # The names have to be unique unfortunately.
27 27
 set(EXECUTABLE_NAME "slop")

+ 3
- 0
src/window.cpp Datei anzeigen

@@ -50,6 +50,9 @@ slop::SlopWindow::SlopWindow() {
50 50
     XSetClassHint( x11->display, window, &classhints );
51 51
     XSetWMProperties( x11->display, window, &textprop, &textprop, NULL, 0, &sizehints, startup_state, NULL );
52 52
     XFree( startup_state );
53
+	// Keep the window on top of all other windows.
54
+	Atom stateAbove = XInternAtom(x11->display, "_NET_WM_STATE_ABOVE", False);
55
+	XChangeProperty(x11->display, window, XInternAtom(x11->display, "_NET_WM_STATE", False), XA_ATOM, 32, PropModeReplace, (unsigned char *) &stateAbove, 1);
53 56
 
54 57
     // Load up a opengl context
55 58
     context = glXCreateContext( x11->display, &visual, 0, True );