Commit Graph

2577 Commits

Author SHA1 Message Date
Campbell Barton
3180f16cef Merge branch 'blender-v4.0-release' 2023-10-12 14:20:26 +11:00
Campbell Barton
3d90af5ae1 Merge branch 'blender-v4.0-release' 2023-10-12 14:20:19 +11:00
Campbell Barton
ecde39baf3 Fix #113328: Wrong startup window size with fractional scale on Wayland
The output's XDG scale wasn't available at startup, add a round-trip
to resolve this.
2023-10-12 14:18:53 +11:00
Campbell Barton
ee15925716 Fix incorrect screen-size under Wayland with transformed outputs
- The transform was incorrectly accessed as a flag.
- Missing checks for 270 degree rotation.
2023-10-12 14:18:51 +11:00
Harley Acheson
0deb4f3e98 Merge branch 'blender-v4.0-release' 2023-10-11 18:34:04 -07:00
Harley Acheson
6aeadce34b UI: Win32 Warp Margin Adjustment
Windows mouse warping bounds margin needs to be different when not
GHOST_kGrabHide, or else the visible wrapping occurs within the
area at an odd location. Making it 2, like it used to be.
2023-10-11 18:32:11 -07:00
Harley Acheson
fba58a1483 Merge branch 'blender-v4.0-release' 2023-10-11 16:05:09 -07:00
Harley Acheson
67e4af3ea1 Fix #113511: Win32 Warping Needs Screen Edge Margin
Windows mouse warping requires a margin when the bounds are at screen
edge. Setting a margin of 10% of bounds width tests sufficient.

Pull Request: https://projects.blender.org/blender/blender/pulls/113565
2023-10-12 01:03:53 +02:00
Campbell Barton
db093a4608 Merge branch 'blender-v4.0-release' 2023-10-12 09:27:43 +11:00
Campbell Barton
b8ad624006 Cleanup: use doxygen doc-strings, spelling in comments 2023-10-12 09:26:53 +11:00
Sergey Sharybin
79dc2c7672 Merge branch 'blender-v4.0-release' 2023-10-11 19:12:12 +02:00
Sergey Sharybin
534e7f4470 Fix #112935: Wrong window order handling on macOS 14
The issue was caused by the custom code which was ensuring that closing
About window does not leave application without any key
windows.

Turns out that the windowWillClose is executed when menu is closed,
forcing the custom code to ensure a key window.

The solution is to only perform manual re-ordering if the closing window
was a key window. This both keeps old behavior of ensuring there is a
key window after closing About, and solves the ordering issues when a
window is created or activated via menus.

Pull Request: https://projects.blender.org/blender/blender/pulls/113515
2023-10-11 19:11:41 +02:00
Campbell Barton
5e7a85539d Merge branch 'blender-v4.0-release' 2023-10-10 11:06:29 +11:00
Campbell Barton
951ae52912 GHOST/Wayland: disable assert which can happen during debugging 2023-10-10 11:04:36 +11:00
Harley Acheson
a6a4d45538 Merge branch 'blender-v4.0-release' 2023-10-09 13:10:22 -07:00
Harley Acheson
1d141e721c Fix #109968: Allow Warping on Actual Mouse Bounds
For Color Circle (and Square) and for Walk Navigation, use the actual
region bounds for mouse warping.

Pull Request: https://projects.blender.org/blender/blender/pulls/113066
2023-10-09 22:09:04 +02:00
Campbell Barton
39295476d0 Cleanup: store const events in GHOST's event handling logic 2023-10-08 15:23:40 +11:00
Campbell Barton
fc78182cc8 Refactor: use const event data, use static_casts
In some cases processing events was modifying them, as there can be
multiple event consumers, manipulating events isn't correct.
Even though in practice it didn't cause issues, it's straightforward
not to do this and makes logic easier to reason about.
2023-10-08 15:23:39 +11:00
Campbell Barton
0bf7d15fa6 Cleanup: replace strncpy with memcpy for buffers of a known size 2023-10-08 14:34:27 +11:00
Campbell Barton
8f8a9ef488 Cleanup: remove unused GHOST_kEventTimer
There was a type error assigning customdata, (wmTimer *) was expected
although this data isn't created so it was never hit.
2023-10-08 14:31:15 +11:00
Campbell Barton
0742ef808f Fix writing past struct bounds of GHOST_TEventImeData
IME editing would cast GHOST_TEventImeData to wmIMEData then read/write
an additional member that doesn't exist in GHOST_TEventImeData.

In practice it's likely struct padding prevented this from showing up
as a bug. Nevertheless it's bad practice to rely on this.

- Make GHOST_TEventImeData read-only, move the is_ime_composing boolean
  into the window.
- Add static assert to ensure both structs are the same size.
- Correct code comments.
2023-10-08 14:29:08 +11:00
Campbell Barton
519d29423d Fix building WITH_GHOST_DEBUG without NDOF 2023-10-08 14:28:25 +11:00
Campbell Barton
0c91466785 GHOST/Wayland: remove WITH_GHOST_WAYLAND_DBUS
This was only used for accessing cursor themes which only worked
with gnome and wasn't used in official releases.
Use the default theme or the theme defined by XCURSOR_THEME.

Eventually wp_cursor_shape_manager_v1 can be supported which avoids
having to access the theme.
2023-10-07 21:31:15 +11:00
Campbell Barton
e8834565a3 CMake: support building GHOST/X11 without OpenGL 2023-10-07 21:22:15 +11:00
Campbell Barton
f3f494fd63 macOS: fix issues building without OpenGL headers
macOS has WITH_OPENGL_BACKEND disabled but still included
`epoxy/gl.h` and defined an unused NSOpenGLContext.
2023-10-07 20:51:24 +11:00
Campbell Barton
1bb098bf44 CMake: WITH_OPENGL_BACKEND=OFF excludes EGL/EPOXY includes & libraries
This isn't complete as opensubdiv, hydra & XR still depend on OpenGL.
2023-10-07 18:30:17 +11:00
Campbell Barton
a17d6efe98 Cleanup: correct enums used as booleans 2023-10-07 18:28:09 +11:00
Campbell Barton
126cf64004 CMake: quiet undefined variable use with MOLTENVK on non-apple systems 2023-10-07 18:25:44 +11:00
Jeroen Bakker
9a654c04de Vulkan: Wayland Windowing
Wayland WSI would crash the system when used. The reason is that the
wayland vulkan WSI doesn't provide windowing support. Vulkan gets full access
to the desktop of the OS and it is the responsibilty of the application to
do the right thing.

For OpenGL Wayland proved basic windowing support using `wayland-egl.h`.
Which essentially is a tiny wrapper that keeps track of the window position and
size.

This PR changes a few things to make the Wayland surface usable:

- Do not load debug extensions when blender isn't started with
  `--debug-gpu`.
- Recreate swapchain images when surface size changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/113007
2023-10-06 14:45:09 +02:00
Campbell Barton
6b2f9dd71d Merge branch 'blender-v4.0-release' 2023-10-06 17:34:18 +11:00
Campbell Barton
e1dac0b122 Fix glitch resizing windows with LIBDECOR on Wayland
The window contents and the window boarders were noticeably out of sync
when resizing the window quickly.

Resolve by keeping the current size as-is, rely on deferred handling
of the pending window size to apply the new size along with the contents.
2023-10-06 17:32:43 +11:00
Campbell Barton
a110873f52 Merge branch 'blender-v4.0-release' 2023-10-06 17:15:15 +11:00
Campbell Barton
9ddb3143c0 Merge branch 'blender-v4.0-release' 2023-10-06 17:15:13 +11:00
Campbell Barton
b9d300380f Cleanup: correct typo in assertions 2023-10-06 17:13:44 +11:00
Campbell Barton
d59a79ef95 Fix redundant window activation/deactivation events under Wayland
Any window state change (resizing for e.g.) triggered
activation/deactivation events. Resolve by only sending events on state
change. The activation caused cursor motion events from #107594.
2023-10-06 17:12:32 +11:00
Campbell Barton
31dce9d11d Merge branch 'blender-v4.0-release' 2023-10-06 16:21:01 +11:00
Campbell Barton
36021021aa GHOST/Wayland: remove window activation on tablet proximity in
Activating on tablet proximity isn't needed and would activate windows
that were already active. The window manager handles activation.
2023-10-06 16:20:08 +11:00
Campbell Barton
ba472eb69e Merge branch 'blender-v4.0-release' 2023-10-06 16:16:58 +11:00
Campbell Barton
c413a8d183 Fix error clearing the windows libdecor state on failure on Wayland
API docs note the state should remain unchanged when accessing the state
fails.
2023-10-06 16:15:47 +11:00
Jeroen Bakker
6e18bb4e3e Vulkan: Make Maintenance4 Extension Optional
`VK_KHR_maintenance4` extension is core in Vulkan 1.3. As Blender
should support Vulkan 1.2 we should not enable this extension when
it isn't available.This fixes issue to run Vulkan backend on some
platforms (Intel Iris Plus).

Maintenance4 is used to relax the interface matching rules to allow
a larger output vector to match with a smaller input vector, with
additional values being discarded.

When Maintenance4 isn't enabled a few shaders might run a tiny bit
slower as it triggers a performance notice. Users won't notice the
performance slowdown.

Pull Request: https://projects.blender.org/blender/blender/pulls/113239
2023-10-05 13:40:28 +02:00
Dalai Felinto
a9aa0c3fc8 Cleanup: make format 2023-10-05 10:20:09 +02:00
Jeroen Bakker
9f891b6f98 Cleanuip: Make format 2023-10-05 09:33:12 +02:00
Campbell Barton
60b2b663cc Merge branch 'blender-v4.0-release' 2023-10-05 13:16:20 +11:00
Campbell Barton
c9130e38e3 Cleanup: spelling in comments 2023-10-05 13:07:58 +11:00
Germano Cavalcante
bd6b7088bf Fix #112978: MacOS no longer has a path associated with the window
The problem was introduced in 636f3697ee

MacOS has a different way of handling the title.

In this OS the directory is searched and taken from the title string
which is then formatted.

This limits the title format and makes it prone to errors.

This commit makes the code more generic by splitting each component of
the title beforehand and allowing the associated directory to be informed
with `GHOST_SetTitle`.

Pull Request: https://projects.blender.org/blender/blender/pulls/113227
2023-10-05 02:26:11 +02:00
Germano Cavalcante
d6b2b5d0c5 Fix #112978: MacOS no longer has a path associated with the window
The problem was introduced in 636f3697ee

MacOS has a different way of handling the title.

In this OS the directory is searched and taken from the title string
which is then formatted.

This limits the title format and makes it prone to errors.

This commit makes the code more generic by splitting each component of
the title beforehand and allowing the associated directory to be informed
with `GHOST_SetTitle`.
2023-10-04 21:23:38 -03:00
Sergey Sharybin
d7a21d0199 Merge branch 'blender-v4.0-release' 2023-10-04 18:10:50 +02:00
Sergey Sharybin
d522938fd5 macOS: Enable secure coding for restorable state
There are secure implications of not using secure coding for the
restorable state described in the following article:

  https://sector7.computest.nl/post/2022-08-process-injection-breaking-all-macos-security-layers-with-a-single-vulnerability/

Starting with macOS 14 this secure coding is enabled implicitly
but with a warning printed into the console with a note that it
does not affect other versions of macOS.

This change makes it so the secure coding is used explicitly on
all supported macOS versions.

Blender does not use the restorable state itself, and used its
own code to take care of window placement, so there should be
no user-measurable changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/113240
2023-10-04 18:09:27 +02:00
Campbell Barton
ddad645157 Fix use after free error in recent check for EGL context
Correct error in [0].

[0]: 5ae917ffe9
2023-10-04 13:16:44 +11:00
Campbell Barton
5ae917ffe9 Fix GHOST_SystemWayland::disposeContext assuming an EGL context
Only destroy the EGL window for OpenGL contexts.
2023-10-04 10:17:36 +11:00