Parcourir la source

Fixed a bug where an InputOnly window would be selected.

naelstrof il y a 7 ans
Parent
révision
90192110ec
4 fichiers modifiés avec 8 ajouts et 3 suppressions
  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 Voir le fichier

@@ -21,7 +21,7 @@ endif()
21 21
 
22 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 26
 # The names have to be unique unfortunately.
27 27
 set(EXECUTABLE_NAME "slop")

+ 1
- 1
slop.1 Voir le fichier

@@ -34,7 +34,7 @@ Sets the selection rectangle's color. Supports RGB or RGBA input. Depending on t
34 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 35
 .TP
36 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 38
 .TP
39 39
 .BR \-n ", " \-\-nodecorations=INT
40 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 Voir le fichier


+ 6
- 1
src/mouse.cpp Voir le fichier

@@ -104,12 +104,17 @@ Window slop::Mouse::findWindow( Window foo ) {
104 104
         if ( children[i] == ignoreWindow ) {
105 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 108
         XWindowAttributes attr;         
109 109
         XGetWindowAttributes( x11->display, children[i], &attr );
110 110
         if ( attr.map_state != IsViewable ) {
111 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 118
         glm::vec4 rect = getWindowGeometry(children[i], false);
114 119
         float a = pos.x - rect.x;
115 120
         float b = pos.y - rect.y;