Browse Source

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

naelstrof 7 years ago
parent
commit
e787f1b15a
2 changed files with 4 additions and 1 deletions
  1. 1
    1
      CMakeLists.txt
  2. 3
    0
      src/window.cpp

+ 1
- 1
CMakeLists.txt View File

21
 
21
 
22
 include_directories("${PROJECT_BINARY_DIR}")
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
 # The names have to be unique unfortunately.
26
 # The names have to be unique unfortunately.
27
 set(EXECUTABLE_NAME "slop")
27
 set(EXECUTABLE_NAME "slop")

+ 3
- 0
src/window.cpp View File

50
     XSetClassHint( x11->display, window, &classhints );
50
     XSetClassHint( x11->display, window, &classhints );
51
     XSetWMProperties( x11->display, window, &textprop, &textprop, NULL, 0, &sizehints, startup_state, NULL );
51
     XSetWMProperties( x11->display, window, &textprop, &textprop, NULL, 0, &sizehints, startup_state, NULL );
52
     XFree( startup_state );
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
     // Load up a opengl context
57
     // Load up a opengl context
55
     context = glXCreateContext( x11->display, &visual, 0, True );
58
     context = glXCreateContext( x11->display, &visual, 0, True );