Commit Graph

2766 Commits

Author SHA1 Message Date
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]: 7371b11bb5
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]: 6549019ae1
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]: 1455315111
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 4bf6a2e564.
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
Campbell Barton 510a7ff452 Merge branch 'blender-v4.1-release' 2024-02-08 12:42:23 +11:00
Koranir bba1893f67 Fix crash with fractional scaling on Wayland with NVIDIA graphics
Ref: !117531
2024-02-08 12:34:35 +11:00
Campbell Barton 67c12236e6 GHOST/WIN32: remove start time offset from getMilliSeconds
This isn't necessary and has been removed from macOS & X11,
Wayland never did this.

Besides removing the offset GetTickCount() has been replaced by
GetTickCount64 to prevent 32bit rollover when high resolution timers
aren't supported.

Ref !117618
2024-02-08 08:53:34 +11:00
Jacques Lucke 319b911784 Cleanup: move hash and ghash utils to C++
Also see #103343.

Pull Request: https://projects.blender.org/blender/blender/pulls/117761
2024-02-02 19:55:06 +01:00
Hans Goudey 7fa5fc02b7 Cleanup: Move BLF headers to C++ 2024-01-31 14:04:56 -05:00
Campbell Barton dab6515374 Cleanup: remove references to start time in X11
Missed from recent removal.
2024-01-29 11:53:43 +11:00
Campbell Barton a73419363c GHOST/SDL: use SDL_GetTicks64 to prevent wrapping the 32 bit uint time 2024-01-29 11:47:46 +11:00
Campbell Barton 05807b0662 GHOST/X11: remove start-time offset from getMilliSeconds
Remove since this isn't needed, not done by other platforms.
2024-01-29 11:47:45 +11:00
Campbell Barton 18eb7e7502 Cleanup: correct doc-strings for GHOST_GetMilliSeconds
Wayland, macOS & SDL weren't using the start-time of the process.

The start-time offset isn't needed so it's similar to forward the
systems method of accessing the time in milliseconds.
2024-01-29 11:47:43 +11:00
Brecht Van Lommel 38647b6dc2 Fix: suspicious time-stamp console warnings on macOS
Use the correct current time API function that matches NSEvent timestamp.
2024-01-27 00:22:49 +01:00
Hans Goudey 99f9084bee Cleanup: Replace some CLAMP macros with C++ functions
Pull Request: https://projects.blender.org/blender/blender/pulls/117460
2024-01-23 21:10:33 +01:00
Aras Pranckevicius a705259b4b Cleanup: move imbuf .h files to .hh 2024-01-19 20:29:38 +01:00
ESASHIKA Kaoru c0bc49f035 GHOST: Support for Additional 3Dconnextion Devices
Add support for additional 3Dconnextion devices, specifically the Space
Mouse Pro Wireless when connected directly and for the wireless
connection.

Pull Request: https://projects.blender.org/blender/blender/pulls/116393
2024-01-18 17:48:35 +01:00
Harley Acheson 0f8c8e475a UI: Improved Default GetWindowUnderCursor Behavior
For default GetWindowUnderCursor (when there is not a platform-specific
version), search windows in reverse order. This is because in most
cases with overlapping windows the one that is on top was created after
those that are below it.

Pull Request: https://projects.blender.org/blender/blender/pulls/111489
2024-01-15 20:27:47 +01:00
sjfricke c9c01724b9 Vulkan: Add shaderClipDistance feature
Various GLSL shaders use gl_ClipDistance and without the feature
enabled validation layers errors are triggered

Pull Request: https://projects.blender.org/blender/blender/pulls/116530
2024-01-15 15:02:19 +01:00