Commit Graph

2781 Commits

Author SHA1 Message Date
Campbell Barton
dcec5ce635 GHOST/Wayland: bump wl_compositor_interface version from 3 to 6 2024-04-14 17:55:14 +10:00
Campbell Barton
6689053e43 GHOST/Wayland: bump wl_output_listener version from 2 to 4 2024-04-14 17:55:13 +10:00
Campbell Barton
8d86fb43a4 GHOST/Wayland: bump wl_seat_interface version from 5 to 9
This ensures callbacks are called to detect "natural" scroll direction
on the touch-pad, see: #107676.
2024-04-14 17:55:11 +10:00
Campbell Barton
98cb5da6d1 GHOST/Wayland: add an interface version clamping macro
This macro makes it convenient to define a supported version range for
an interface.

Uncommenting USE_VERBOSE_OLD_IFACE_PRINT prints when newer versions
of an interface are supported by the compositor which Blender could
be updated to support.

This makes it more convenient to bump interface versions as they
become available so bumping multiple versions at once doesn't
cause unexpected changes in behavior as happened with #120587.
2024-04-14 17:55:10 +10:00
Campbell Barton
df87770ca1 GHOST/Wayland: resolve mouse wheel being treated like touchpad scroll
Resolves the issue reported in #120587, which occurred when bumping the
supported version of the seat API to 9.

Smooth scrolling values were set in without calling the discrete step
callback. Resolve by calculating discrete values from the:
wl_pointer_listener::axis_value120 handler.

The functional changes from this commit only apply once the version
of the seat API is increased - which isn't part of this commit.
2024-04-14 17:55:09 +10:00
Campbell Barton
e27889dc12 Cleanup: use const references for GWL_RegistryHandler parameters 2024-04-14 17:54:59 +10:00
Campbell Barton
dce8668b1f GHOST/Wayland: use discrete zoom steps with multi-touch disabled
This matches behavior on macOS as well as the property description.

On Wayland, smooth scrolling doesn't use the touchpad API,
so disabling multi-touch gestures doesn't change the behavior as it
does on macOS.

Resolve by converting vertical touch scrolling to mouse-wheel events.
2024-04-14 14:56:30 +10:00
Campbell Barton
f12d20a819 Cleanup: always reset discrete mouse-wheel
A correctness issue, this didn't cause any bugs.
2024-04-14 14:23:36 +10:00
Campbell Barton
6e3eaae299 Cleanup: spelling in comments 2024-04-14 12:13:55 +10:00
Campbell Barton
bf3ca83df9 Cleanup: use C-style comments for descriptive text in GHOST/Cocoa 2024-04-14 09:40:19 +10:00
Hans Goudey
30c3f8eafb Revert "Fix #107676 detection of "natural" touchpad scrolling on Wayland"
This reverts commit af88ff04848b1ff299514514fb18ecf401553bb4.

That commit broke scrolling (at least in some cases).
Reverting the commit resolves #120587
2024-04-12 11:47:03 -04:00
Campbell Barton
af88ff0484 Fix #107676 detection of "natural" touchpad scrolling on Wayland
The callback to set the relative direction wasn't running because
it required GHOST to request version 9 of the wl_seat_interface.

Natural touchpad events now work for KDE 6 and recent versions
of WLROOTS based compositors, GNOME 46 is uses wl_seat_interface
version 8 which still wont work.
2024-04-13 00:18:21 +10:00
Jeroen Bakker
c15e5116ab Vulkan: MoltenVK Support for Developers
MoltenVK original intent was to let developers work on a mac system developing
for the vulkan eco-system. MoltenVK doesn't support all the features that we
require and would require additional workarounds to be actually supported.

It is not expected that we will release Blender with MoltenVK for this reason.
But it still has value for shader developers to validate shaders on metal and
vulkan on a single platform.

![image](/attachments/9a4a9904-a5f6-4922-896d-744dfb78244c)

Pull Request: https://projects.blender.org/blender/blender/pulls/117940
2024-04-11 11:04:43 +02:00
Campbell Barton
01187dfc8e GHOST: add missing check for end full-screen failing 2024-04-08 12:03:01 +10:00
Harley Acheson
b32effdaa8 GHOST/WIN32: Remove Initial UpdateWindow
We call UpdateWindow very early in our window creation, before we get
an openGl surface and before our message queue is ready. This results
in WM_ACTIVATE, WM_SIZE, WM_MOVE, and WM_PAINT messages sent to us
at a time when GetMessageTime() returns zero. This makes our event
message times have a gap between the fourth and fifth messages, equal
to the time since system start. There is no downside to not calling
this at this time.

Pull Request: https://projects.blender.org/blender/blender/pulls/117965
2024-04-05 00:34:23 +02:00
Campbell Barton
97d93c7e33 GHOST/Wayland: pass in null when the cursor theme isn't set
While an empty string resolves to the default theme, it's not following
the API specification for wl_cursor_theme_load as it's written.

Checking on wayland internals this looks only to add an unnecessary
theme lookup on an empty string which falls back to the default.

Noticed when investigating #105895 although it seems unlikely
that this chagne would resolve the issue.
2024-04-02 15:11:05 +11:00
Campbell Barton
3f7742f65d GHOST/Wayland: only apply #119871 workaround with LIBDECOR
Disable fix from [0] unless LIBDECOR is used.

This caused:
- KDE 6.0.2 to fail to start full-screen.
- RIVERWM to show a blank preferences.
- HYPRLAND to assert with a negative window height
  when starting full-screen.

Also replace flush & dispatch with a round-trip which fixes an error
on GNOME with non maximized/full-screen windows not showing any contents
on startup until a redraw was triggered.

[0]: 7371b11bb5a5eed0205fba2c8400546073a628d6
2024-03-27 15:04:03 +11:00
Hans Goudey
fc0d8ba012 Cleanup: Remove C++ ifdef checks in C++ headers
Pull Request: https://projects.blender.org/blender/blender/pulls/119900
2024-03-26 04:56:03 +01:00
Campbell Barton
7371b11bb5 Fix #119871: Window contents invalid on startup under Wayland & GNOME
Resolve a glitch where the window contents didn't fit the window
on startup under GNOME. This also avoids flickering whenever the
window manager changed the window size from the requested size.

See code-comments for details.
2024-03-25 22:08:27 +11:00
Hans Goudey
8b514bccd1 Cleanup: Move remaining GPU headers to C++
Pull Request: https://projects.blender.org/blender/blender/pulls/119807
2024-03-23 01:24:18 +01:00
Jose Vicente Barrachina
692de6d380 GHOST/Wayland: copy & paste image to clipboard support
Adds copy and paste images functionality to and from the image editor
in Linux/Wayland clipboard.

Currently the only format supported is PNG.

Ref: !119117
2024-03-12 17:42:02 +11:00
Campbell Barton
8c276cb073 Merge branch 'blender-v4.1-release' 2024-03-12 17:04:59 +11:00
Campbell Barton
353ec1090a Unbreak build with USE_EVENT_BACKGROUND_THREAD disabled 2024-03-12 17:03:09 +11:00
Campbell Barton
74d9fb60ba Cleanup: use 'const' where possible, remove redundant check 2024-03-09 16:38:25 +11:00
Campbell Barton
0cd414120b Unbreak build on macOS with AppleClang from recent cleanup
Exact an exact match with Clang broke building when the compiler ID
was "AppleClang", reverting parts of [0].

[0]: 6549019ae19cecbea524782054dca0e99cb833b8
2024-03-07 19:56:58 +11:00
Campbell Barton
6549019ae1 Cleanup: use STREQUAL instead of MATCHES for exact comparisons
MATCHES takes a REGEX and searches the input for a match,
this isn't necessary for CMAKE_SYSTEM_PROCESSOR & CMAKE_*_COMPILER_ID.
2024-03-07 17:56:41 +11:00
Anthony Roberts
445fd42c61 Windows: Add ARM64 support
* Only works on machines with a Qualcomm Snapdragon 8cx Gen3 or above.
  Older generation devices are not and will not be supported due to
  some driver issues
* Requires VS2022 for building.
* Uses new MSVC preprocessor for sse2neon compatibility.
* SIMD is not enabled, waiting on conversion of blenlib to C++.

Ref #119126

Pull Request: https://projects.blender.org/blender/blender/pulls/117036
2024-03-06 16:14:34 +01:00
Campbell Barton
76867ad4c2 Cleanup: redundant "void" in function declarations for C++ 2024-03-05 11:25:35 +11:00
Campbell Barton
4701879f52 Merge branch 'blender-v4.1-release' 2024-02-28 16:09:47 +11:00
Campbell Barton
7f8fcddba5 Merge branch 'blender-v4.1-release' 2024-02-28 16:09:42 +11:00
Campbell Barton
503de16353 Fix #117583: Inaccessible title bar buttons on GNOME/Wayland
New windows on GNOME with LIBDECOR windowing would sometimes have an
unusable title-bar with the whole title-bar acting as the edge-resize.

Would happen predictably when opening large windows which the window
manager would resize to fit the display.

The cause of this was Blender receiving a window configure event
without a window size for new windows. This configure event
would be ignored, causing the title bar not to work properly.

This is a regression from [0] which removed logic to calculate the
window size from the arguments passed to GHOST for window creation.
This wasn't correct either as the it could temporarily set the
window size before the requested size configuration was received.

Resolve the problem by queuing configuration requests,
handling them then the requested window size is known.

[0]: 1455315111ae769d101413fe600662484ff46d62
2024-02-28 16:07:10 +11:00
Campbell Barton
cec6d57107 Fix memory leak with Wayland & LIBDECOR
The configuration was cleared before freeing.
2024-02-28 16:05:05 +11:00
Hans Goudey
caf567e241 Cleanup: Resolve unused variable warning in GHOST EGL code 2024-02-22 12:45:57 -05:00
Brecht Van Lommel
ca8a7c7054 Merge branch 'blender-v4.1-release' into main 2024-02-21 18:35:59 +01:00
Brecht Van Lommel
4c708a8c3e Linux: Avoid XDG_RUNTIME_DIR warnings running headless Blender
Pull Request: https://projects.blender.org/blender/blender/pulls/118530
2024-02-21 18:35:15 +01:00
Brecht Van Lommel
873472b747 Linux: Improve headless EGL initialization messages
When it succeeds, don't print an error message. When it fails, print
errors for both display and headless attempts.

Pull Request: https://projects.blender.org/blender/blender/pulls/118530
2024-02-21 18:35:10 +01:00
Campbell Barton
63f482d550 Merge branch 'blender-v4.1-release' 2024-02-21 14:10:00 +11:00
Campbell Barton
479b46ca93 Fix #117896: Key-modifiers on window activation fails under Wayland
Register the last held key when activating a window
(not only modifiers keys) under Wayland.

This resolves a bug where holding the D-key and clicking on a window
wouldn't activate grease pencil drawing.
2024-02-21 14:09:04 +11:00
Harley Acheson
9e852d9471 UI: Mac Incorrect Hand Cursor for Move
On the MacOS platform, use openHandCursor for GHOST_kStandardCursorMove
not pointingHandCursor. This cursor is meant to indicate an item that
you can move or adjust. The pointingHandCursor is meant for links to
documents, web pages, etc.

Pull Request: https://projects.blender.org/blender/blender/pulls/118423
2024-02-19 18:00:36 +01:00
Brecht Van Lommel
0f2064bc3b Revert changes from main commits that were merged into blender-v4.1-release
The last good commit was 4bf6a2e564ad2.
2024-02-19 15:59:59 +01:00
Harley Acheson
4acbda91f8 Merge branch 'blender-v4.1-release' 2024-02-17 11:30:55 -08:00
Harley Acheson
a677518cb5 Fix #118351: Pixel Shift with Win32 Clipboard DibV5 Image Transfer
My misreading of the Microsoft BITMAPV5HEADER specification causes a
shift of three pixels when transferring between applications using this
format. This does not occur when moving within or between Blender
instances. This PR just removes the incorrect 12-byte offset. Note
that many applications prefer PNG transfers over DibV5 so testing this
might be non-obvious.

Pull Request: https://projects.blender.org/blender/blender/pulls/118417
2024-02-17 20:29:41 +01:00
Campbell Barton
c47c1275a9 Merge branch 'blender-v4.1-release' 2024-02-17 14:57:07 +11:00
Campbell Barton
a8ca12f2a8 Fix #118233: No preference to disable multi-touch gestures on Wayland
Support this preference for Wayland, following macOS & WIN32 support.
2024-02-17 14:55:12 +11:00
Brecht Van Lommel
7453c5ed67 Merge branch 'blender-v4.1-release' into main 2024-02-16 19:31:31 +01:00
Raul Fernandez
324ff4ddef macOS: Remove unnecessary checks now that minimum version is macOS 11.2
MacOS minimum version is now 11.2 we no longer need to check for lower API versions.

Pull Request: https://projects.blender.org/blender/blender/pulls/118388
2024-02-16 19:03:23 +01:00
Campbell Barton
07ff3bcb70 GHOST/Wayland: support dropping text
This matches X11's support for GHOST_kDragnDropTypeString.

Dropping URL's from a web-browser uses this mime-type.
2024-02-16 14:27:00 +11:00
Campbell Barton
82c753a940 GHOST/Wayland: drag & drop cleanup, minor changes
- Don't generate a drop event when the drop data failed to read.
- Remove redundant drop-buffer duplication.
2024-02-16 14:26:58 +11:00
Campbell Barton
67481dcd47 Merge branch 'blender-v4.1-release' 2024-02-15 21:22:56 +11:00
Campbell Barton
4b7d44d015 Fix incorrect use of sizeof() for Wayland
The size of the string in bytes happened to match the the pointer size
on 64bit systems, nevertheless the logic was wrong would would fail on
32bit systems. Also use a character to search the string instead of a
single character string.
2024-02-15 20:56:45 +11:00