Ignoring mouse events / transparent for inputs / disable hit testing #1236
Labels
enhancement
Feature suggestions and PRs
macOS
Wayland
Windows
Win32 specific (not Cygwin or WSL)
X11
Projects
Milestone
Hello,
Using a long subject line because I don't know what is the most appropriate cross-platform terminology and people might search for this under different names
This is feature request for a window hint, let's tentatively call it
GLFW_MOUSE_PASSTHRU
(exact naming to be determined). I am using it as part of the same work I mentioned in #1166 (GIF at the end of this post).(Note, this is unrelated to transparency from a visual point of view, already discussed many times here: https://github.com/glfw/glfw/issues?utf8=%E2%9C%93&q=transparent)
Windows
The WndProc handler would do:
Mac
I think we can use the 'ignoresMouseEvents' property of 'NSWindow' (untested)
https://developer.apple.com/documentation/appkit/nswindow/1419354-ignoresmouseevents?language=objc
Wayland
Possibly 'wl_surface::set_input_region' (untested)
https://wayland.freedesktop.org/docs/html/apa.html#protocol-spec-wl_surface
X11
I'm not sure how X11 works. For reference, Qt uses
xcb_xfixes_create_region()
+xcb_xfixes_set_window_shape_region_checked
:https://git.merproject.org/mer-core/qtbase/blob/master/qtbase/src/plugins/platforms/xcb/qxcbwindow.cpp#L1151
Context (gif): I am dragging a glfw window (that is right under my mouse cursor) and need to detect the window under so I can drop into them. Similarly to #1166 I can provide a rough (but usable) approximation on client-side by using the desktop size/position of all my windows, but of course this would bypass the window manager and ignore the proper z-order of windows (including windows from foreign application).
EDIT To clarify, at the moment I am testing this by using win32-specific code and installing a WndProc hook.
The naming and my use case are a little tricky because I toggle this feature on an existing GLFW window, and right now I still receive the currently captured mouse position for that window, which is ideal and desirable in my use case, and I think more flexible. This is why I didn't suggest a name like
GLFW_IGNORE_MOUSE_INPUTS
, because both CursorPosCallback and glfwGetCursorPos() still work fine.Thanks for your consideration,
Omar
The text was updated successfully, but these errors were encountered: