Browse Source

Fixed a bug where an InputOnly window would be selected.

naelstrof 7 years ago
parent
commit
90192110ec
4 changed files with 8 additions and 3 deletions
  1. 1
    1
      CMakeLists.txt
  2. 1
    1
      slop.1
  3. BIN
      slop.1.gz
  4. 6
    1
      src/mouse.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.37")
24
+add_definitions(-DSLOP_VERSION="v5.3.38")
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")

+ 1
- 1
slop.1 View File

34
 This sets the vertex shader, and fragment shader combo to use when drawing the final framebuffer to the screen. This obviously only works when OpenGL is enabled. The shaders are loaded from ~/.config/slop. See https://github.com/naelstrof/slop for more information on how to create your own shaders.
34
 This sets the vertex shader, and fragment shader combo to use when drawing the final framebuffer to the screen. This obviously only works when OpenGL is enabled. The shaders are loaded from ~/.config/slop. See https://github.com/naelstrof/slop for more information on how to create your own shaders.
35
 .TP
35
 .TP
36
 .BR \-f ", " \-\-format=\fISTRING\fR
36
 .BR \-f ", " \-\-format=\fISTRING\fR
37
-Sets the output format for slop. Format specifiers are %x, %y, %w, %h, %i, and %g. If actual percentage signs are desired in output, use a double percentage sign like so `%%`.
37
+Sets the output format for slop. Format specifiers are %x, %y, %w, %h, %i, %c, and %g. If actual percentage signs are desired in output, use a double percentage sign like so `%%`.
38
 .TP
38
 .TP
39
 .BR \-n ", " \-\-nodecorations=INT
39
 .BR \-n ", " \-\-nodecorations=INT
40
 Sets the level of aggressiveness when trying to remove window decroations. `0' is off, `1' will try lightly to remove decorations, and `2' will recursively descend into the root tree until it gets the deepest available visible child under the mouse. Defaults to `0'. Supplying slop with just `-n` is equivalent to supplying `-n1`.
40
 Sets the level of aggressiveness when trying to remove window decroations. `0' is off, `1' will try lightly to remove decorations, and `2' will recursively descend into the root tree until it gets the deepest available visible child under the mouse. Defaults to `0'. Supplying slop with just `-n` is equivalent to supplying `-n1`.

BIN
slop.1.gz View File


+ 6
- 1
src/mouse.cpp View File

104
         if ( children[i] == ignoreWindow ) {
104
         if ( children[i] == ignoreWindow ) {
105
             continue;
105
             continue;
106
         }
106
         }
107
-        // We need to make sure the window isn't something that currently isn't mapped.
107
+        // We need to make sure the window is mapped.
108
         XWindowAttributes attr;         
108
         XWindowAttributes attr;         
109
         XGetWindowAttributes( x11->display, children[i], &attr );
109
         XGetWindowAttributes( x11->display, children[i], &attr );
110
         if ( attr.map_state != IsViewable ) {
110
         if ( attr.map_state != IsViewable ) {
111
             continue;
111
             continue;
112
         }
112
         }
113
+        // We need to make sure we can get pixel data from it as well
114
+        if ( attr.c_class == InputOnly ) {
115
+          continue;
116
+        }
117
+
113
         glm::vec4 rect = getWindowGeometry(children[i], false);
118
         glm::vec4 rect = getWindowGeometry(children[i], false);
114
         float a = pos.x - rect.x;
119
         float a = pos.x - rect.x;
115
         float b = pos.y - rect.y;
120
         float b = pos.y - rect.y;