Age | Commit message (Collapse) | Author |
|
|
|
Add a GHOST_kEventWindowDPIHintChanged event to ensure the UI is
properly updated.
|
|
|
|
As mentioned in T89399, "the source of this bug is that cursor wrap
moves the cursor, but when it later checks the mouse position it hasn't
yet been updated, so it re-wraps".
As far as I could see, this happens for two reasons:
1. During the first warp, there are already other mousemove events in the queue with an outdated position.
2. Sometimes Windows occasionally and inexplicably ignores `SetCursorPos()` or `SendInput()` events. (See [1])
The solution consists in checking if the cursor is inside the bounds right after wrapping.
If it's not inside, it indicates that the wrapping either didn't work or the event is out of date.
In these cases do not change the "accum" values.
1. https://github.com/libsdl-org/SDL/blob/f317d619ccd22e60cebf1b09d716d3985359c981/src/video/windows/SDL_windowsmouse.c#L255)
Maniphest Tasks: T89399
Differential Revision: https://developer.blender.org/D15707
|
|
Always unset these variables after use as they could interfere with
other checks made afterwards.
|
|
The dummy `m_system` variable is not needed in the GHOST_NULL classes
|
|
Avoid redundant drawing, match GHOST/GLX behavior.
|
|
Logic for NDOF devices is shared with X11, process events using
GHOST_NDOFManagerUnix when WITH_INPUT_NDOF is enabled.
|
|
|
|
With this patch true headless OpenGL rendering is now possible on Linux.
It changes the logic of the WITH_HEADLESS build flag.
The headless backend is now always available with regular builds and
Blender will try to fall back to it if it fails to initialize other
backends while in background mode.
The headless backend only works on Linux as EGL is not used on Mac or Windows.
libepoxy does support windows and mac, so this can perhaps be remedied in the future.
Reviewed By: Brecht, Jeroen, Campbell
Differential Revision: http://developer.blender.org/D15555
|
|
This cleans up the OpenGL build flags and linking.
It additionally also removes some dead code.
One of these dead code paths is WITH_X11_ALPHA which actually never was
active even with the build flag on. The call to use this was never
called because the default initializer for GHOST was set to have it off
per default. Nothing called this function with a boolean value to enable it.
These cleanups are needed to support true headless OpenGL rendering.
Without these cleanups libepoxy will fail to load the correct OpenGL
Libraries as we have already linked them to the blender binary.
Reviewed By: Brecht, Campbell, Jeroen
Differential Revision: http://developer.blender.org/D15554
|
|
With libepoxy we can choose between EGL and GLX at runtime, as well as
dynamically open EGL and GLX libraries without linking to them.
This will make it possible to build with Wayland, EGL, GLVND support while
still running on systems that only have X11, GLX and libGL. It also paves
the way for headless rendering through EGL.
libepoxy is a new library dependency, and is included in the precompiled
libraries. GLEW is no longer a dependency, and WITH_SYSTEM_GLEW was removed.
Includes contributions by Brecht Van Lommel, Ray Molenkamp, Campbell Barton
and Sergey Sharybin.
Ref T76428
Differential Revision: https://developer.blender.org/D15291
|
|
|
|
I'm still not sure how the `0xFF` value came about, but it's not a
valid virtual key code.
Therefore it should not be used in `MapVirtualKey`.
|
|
|
|
|
|
|
|
|
|
Take advantage of Waylands wl_keyboard_listener.enter callback which
takes an array of keys that are pressed when a window is activated.
Resolves T74684 under Wayland.
|
|
This simplifies accessing modifiers as there is no need to perform
a string lookup each time (which may fail).
|
|
|
|
|
|
Caused by rBa95103f6f4abda2b. Please build blender before committing!
|
|
|
|
Resolve crash on exit after drag & drop in Wayland.
|
|
Paths that contained characters that needed escaping as URL's failed
to import.
Move URL decoding to a new file (GHOST_PathUtils), shared with X11 but
maybe be useful for other platforms too.
|
|
Drag & drop worked with GTK3 apps but not QT5 (pcmanfm-qt for eg)
as files are separated by '\n' instead of '\r\n'.
Resolve by supporting both (follow up to T99737).
|
|
Log the response for dropping events to simplify troubleshooting
drag & drop failure.
|
|
Add IMB_gpu_get_texture_format and GPU_texture_format_description to
retrieve and 'stringify' an eGPUTextureFormat. These are then used in the
image info panel used in several areas across blender.
New Information:
{F13330937}
Reviewed By: jbakker
Maniphest Tasks: T99998
Differential Revision: https://developer.blender.org/D15575
|
|
|
|
Bump the requested seat version to v5, use discreet scroll callback.
Tested with gnome, river & sway.
|
|
The value of number sliders (e.g. the "end frame" button) wrap around to
their pre-click value when dragging them for a very long distance (e.g.
by lifting the mouse off the desk and placing it back on to keep
dragging in the same direction).
The problem is X11-specific, and due to XTranslateCoordinates using a
signed int16 behind the curtains, while its signature and the rest of
Blender uses int32. The solution is to only use XTranslateCoordinates on
(0, 0) to get the delta between the screen and client reference systems,
and applying the delta in a second step.
Differential Revision: https://developer.blender.org/D15507
|
|
When the cursor grabbing was disabled, Blender's internal location
(wmWindow.eventstate) kept the location before un-hiding.
This caused the paint cursor to show in the wrong location after
adjusting the color wheel for e.g.
|
|
Partial support for changing the UI scale while Blender is open.
The scale is set but issues with the window size not updating remain.
|
|
Calculate a scale that's compatible with the cursor size.
Needed so the cursor is always a multiple of scale.
|
|
Also remove redundant check.
|
|
Now only the utf8 buffer is used there is no reason to pass both.
|
|
The text representation of release events is never used,
so only calculate this for press events.
|
|
Quiet warning from [0], no functional change as the this information
was always ignored.
Key release events shouldn't have associated text, this was cleared
for wmEvent's, so there is no reason to pass it from GHOST.
[0]: d6fef73ef110eb43756b7b87c2cba80abae3b39f
|
|
- Remove references to `ISTEXTINPUT` as any keyboard event with it's
utf8_buf set can be handled as text input.
- Update references to the key repeat flag.
|
|
The `ascii` member was only kept for historic reason as some platforms
didn't support utf8 when it was first introduced.
Remove the `ascii` struct members since many checks used this as a
fall-back for utf8_buf not being set which isn't needed.
There are a few cases where it's convenient to access the ASCII value
of an event (or nil) so a function has been added to do that.
*Details*
- WM_event_utf8_to_ascii() has been added for the few cases an events
ASCII value needs to be accessed, this just avoids having to do
multi-byte character checks in-line.
- RNA Event.ascii remains, using utf8_buf[0] for single byte characters.
- GHOST_TEventKeyData.ascii has been removed.
- To avoid regressions non-ASCII Latin1 characters from GHOST are
converted into multi-byte UTF8, when building X11 without
XInput & X_HAVE_UTF8_STRING it seems like could still occur.
|
|
While GHOST/SDL doesn't support non-ASCII text input,
use the UTF8 buffer to be consistent with all other back-ends.
Move the conversion from SDL_KeyboardEvent to ASCII into a function.
Also only lookup this value on key press (not release).
|
|
Now all ghost back-ends support the key repeat flag
(accessed as WM_EVENT_IS_REPEAT from wmEvent.flag).
|
|
Remove unused GHOST_WindowManager::getAnyModifiedState()
|
|
The scale for tablet cursor surfaces was never set, making them display
larger. Now the outputs scale is set for mouse & tablet cursors.
|
|
Simplify logic for initializing the wl_buffer, ensure the cursors
custom data is never heft in a half initialized state.
Also remove the need for multiple calls to close when handling errors.
|
|
This was allocated and only used to store the custom cursor data.
Use a pointer & size member instead for simplicity.
|
|
Avoid ifdef's in cursor loading by creating a memfd_create_sealed
utility function that works irrespective of memfd_create availability.
|
|
- Memory from the prior cursor was never un-mapped.
- posix_fallocate failure left a file handle open..
|
|
Add logging to all Wayland listener callbacks as it can be difficult
to detect the cause of problems.
Using break-points often isn't practical for debugging interactive
windowing / compositor issues
Logging needs to be enabled on the command line, e.g:
blender --log "ghost.wl.*" --log-level 2 --log-show-basename
|