Commit Graph

1776 Commits

Author SHA1 Message Date
Harley Acheson
999f1f7504 Win32: Window Placement DPI and Scale Adjustment
When using multiple monitors that differ in scale and/or dpi, the
varying sizes of the window titles and borders can cause the placement
of those windows to be out by a small amount. This patch adjusts for
those differences on Windows 10 and newer.

see D10863 for details and examples.

Differential Revision: https://developer.blender.org/D10863

Reviewed by Ray Molenkamp
2021-06-29 09:29:40 -07:00
Harley Acheson
63aa6dd845 Cleanup: Win32 Window Creation
This is just some cleanup of the Win32 window creation code. After
CreateWindowExW() this patch uses some early exits to replace some
potentially confusing if blocks. No functional changes.

Differential Revision: https://developer.blender.org/D11446

Reviewed by Ray Molenkamp
2021-06-29 08:51:51 -07:00
Nicholas Rishel
e1a719c043 Fix T89465: Loss of mouse movement when window left with pen.
When a window is left with a WinPointer pen, the inrange check
prevents resetting pen info.
2021-06-28 15:09:59 -07:00
Campbell Barton
1d8648b13a Cleanup: repeated terms in code comments & error messages 2021-06-28 15:46:08 +10:00
Campbell Barton
abc6200331 Cleanup: spelling 2021-06-26 21:50:48 +10:00
Campbell Barton
f1e4903854 Cleanup: full sentences in comments, improve comment formatting 2021-06-26 21:50:48 +10:00
Christian Rauch
3d7021b4ec GHOST/XR: support Wayland via XrGraphicsBindingOpenGLWaylandKHR 2021-06-24 18:40:05 +01:00
Christian Rauch
b129a0b397 GHOST: remove unused EGL context includes in Win32 and Cocoa 2021-06-24 18:40:05 +01:00
Christian Rauch
5f27a5fff7 GHOST/EGL: store pointer to GHOST_System for downcast tests 2021-06-24 18:40:05 +01:00
Christian Rauch
b801db1181 GHOST/Wayland: auto-select highest supported OpenGL version 2021-06-24 18:40:05 +01:00
Brecht Van Lommel
b5840f9b5b Cleanup: compiler warnings with clang
* Mark either all or no class methods with override
* Don't use zero sized array since it has a different size in C and C++.
  Using a little more memory here is not significant.
* Don't use deprecated mechanism to mark private GSet members in clang
  just like we don't for MSVC, it warns even for simple zero initialization.
2021-06-24 19:35:23 +02:00
Campbell Barton
4b9ff3cd42 Cleanup: comment blocks, trailing space in comments 2021-06-24 15:59:34 +10:00
Campbell Barton
2e99a74df9 Cleanup: use '#if 0' for commented code-block 2021-06-24 15:53:26 +10:00
Campbell Barton
55bffa82da Cleanup: clang-format, spelling 2021-06-24 15:53:26 +10:00
Nicholas Rishel
d6212f67a9 Remove window iteration in WM_DISPLAYCHANGE.
Iteration was incorrectly calling the same object. Had it called every
window it would still be unnecessary as WM_DISPLAYCHANGE is sent to all
broadcast receiving windows.
2021-06-23 10:12:21 -07:00
Campbell Barton
5cc8e7ab53 Cleanup: reformat trailing comments that caused line wrapping 2021-06-23 13:54:12 +10:00
Christian Rauch
abb07a38b8 GHOST/XR: fix code format 2021-06-22 22:05:47 +01:00
Christian Rauch
0732a9f1b2 GHOST/XR: enable X11-EGL context for OpenXR 2021-06-22 20:00:40 +01:00
Christian Rauch
87833f8f95 GHOST/EGL: add GHOST_XrGraphicsBindingOpenGL as friend 2021-06-22 20:00:40 +01:00
Christian Rauch
b35ba22d84 GHOST/EGL: getters for display, config and context 2021-06-22 20:00:40 +01:00
Christian Rauch
c6e6a9046e GHOST/EGL: ignore unused variables 2021-06-22 20:00:40 +01:00
Leon Zandman
c317f111c1 Cleanup: Spelling Mistakes
This patch fixes many minor spelling mistakes, all in comments or
console output. Mostly contractions like can't, won't, don't, its/it's,
etc.

Differential Revision: https://developer.blender.org/D11663

Reviewed by Harley Acheson
2021-06-22 10:54:50 -07:00
Campbell Barton
67ee87a6e9 Cleanup: spelling 2021-06-22 14:23:37 +10:00
Campbell Barton
53e1442ac2 Cleanup: comment use C comment-blocks for GHOST_Types.h
Also use full sentences, and correct typos.
2021-06-22 14:23:37 +10:00
Nicholas Rishel
6f158f834d Refactor of Wintab to use Wintab supplied mouse movement once verified against system input.
Reviewed By: brecht, LazyDodo

Maniphest Tasks: T88852

Differential Revision: https://developer.blender.org/D11508
2021-06-21 14:38:51 -07:00
Nicholas Rishel
1f251b7a27 Win8 cleanup, remove dead function pointer and macro. 2021-06-14 14:41:58 -07:00
Nicholas Rishel
2e46a8c864 Remove noop code from WM_MOUSEWHEEL processing.
ChildWindowFromPoint retrieves the child of the provided window at a
point. In this case it always returns 0 because HWND_DESKTOP is flag
defined as 0, which is never a valid window handle and is not intended
for use in place of a window handle.

Forwarding of mousewheel events was added in adb08def61, and later
modified to the current unworking state in e9645806f5. Sending mouse
wheel events to the window under the cursor is a system preference and
therefore should not be overridden by Blender, therefore the noop code
has been removed.
2021-06-07 20:15:28 -07:00
Campbell Barton
022f8b552d Cleanup: spelling in comments
Also remove reference to function that never existed for adding `bNode`.
2021-06-05 15:03:59 +10:00
Christian Rauch
b414322f26 GHOST/wayland: fix restoring hidden cursor 2021-06-03 18:18:27 +01:00
Christian Rauch
899eefd1bb GHOST/wayland: fix non-moving normal cursor 2021-06-03 18:18:27 +01:00
Christian Rauch
72607feb91 GHOST/wayland: add 'xdg-decoration' support 2021-06-03 18:18:27 +01:00
Christian Rauch
870bcf6e1a GHOST/wayland: adapt window and cursor surface scale to support HiDPI screens 2021-06-03 18:18:27 +01:00
Christian Rauch
8b78510fc4 GHOST/wayland: handle return values for data sources 2021-06-03 18:18:27 +01:00
Christian Rauch
e0bc5c4087 GHOST/wayland: set parent relation only for dialogs to mimic X11 behaviour 2021-06-03 18:18:27 +01:00
Christian Rauch
1fd653dd82 GHOST/wayland: handle missing relative-pointer and pointer-constraints support 2021-06-03 18:18:27 +01:00
Christian Rauch
d9aae38bc8 GHOST/wayland: get cursor settings via D-Bus 2021-06-03 18:18:27 +01:00
Christian Rauch
efad9bcdda GHOST/wayland: inhibit warning 2021-06-03 18:18:27 +01:00
Christian Rauch
bb16f96973 GHOST/wayland: set swap interval to 0
The Wayland server will not update hidden surfaces. This will block the
main event loop and thus also block updates to visible windows in a multi-
window setup.
2021-06-03 18:18:27 +01:00
Ray Molenkamp
aebeb85fe0 Windows: Clean-up win 8/8.1 API use
For 2.93 we bumped the minimum windows requirement
to windows 8.1, but did not do any clean-up of any
win 8/8.1 API usage we dynamically accessed though
LoadLibrary/GetProcAddress.

This patch bumps _WIN32_WINNT to 0x0603 (win 8.1)
and cleans up any API use that was accessed in a
more convoluted way than necessary

Differential Revision: https://developer.blender.org/D11331

Reviewed by: harley, nicholas_rishel
2021-05-31 08:56:57 -06:00
Pratik Borhade
0606a37e1a Fix T88500: Constrain window top position (Win32)
Do not allow a window to be created that has a top position that
can obscure all or part of title bar. Right and Left edges can
still be specified slightly outside of monitor bounds, but top
edge must be clamped to monitor top.

see D11371 for more details.

https://developer.blender.org/D11371

Reviewed by Ray Molenkamp
2021-05-24 11:46:35 -07:00
Harley Acheson
4fb052f08d Fix T88384: Improved Win32 Window Sizing and Positioning
When creating Win32 windows, the sizes and placements can be out by a
small amount, mostly noticeable near monitor edges. This is because
Windows 10 includes a thin invisible border (typically 7 pixels) when
determining position. Therefore the correct values can sometimes be
just outside the monitor bounds, but we clamp them at those bounds.

This patch fixes this by first clamping the requested values to monitor
bounds, adjusting for window chrome with AdjustWindowRectEx(), and then
using those adjusted values in CreateWindowExW().

see D11314 for more details.

Differential Revision: https://developer.blender.org/D11314

Reviewed by Ray Molenkamp
2021-05-21 09:34:58 -07:00
Ray Molenkamp
1400fdf558 Fix petty comment.
I'm embarrassed this was in our codebase for 18 years
2021-05-20 12:38:01 -06:00
Campbell Barton
44e7192745 Cleanup: spelling 2021-05-20 17:55:35 +10:00
Peter Kim
cb12fb78ca XR Controller Support Step 1: Internal Abstractions for OpenXR Actions
Adds internal API for creating and managing OpenXR actions at the
GHOST and WM layers. Does not bring about any changes for users since
XR action functionality is not yet exposed in the Python API (will be
added in a subsequent patch).

OpenXR actions are a means to communicate with XR input devices and
can be used to retrieve button/pose states or apply haptic feedback.
Actions are bound to device inputs via a semantic path binding
(https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#semantic-path-interaction-profiles),
which serves as an XR version of keymaps.

Main features:

- Abstraction of OpenXR action management functions to GHOST-XR,
  WM-XR APIs.
- New "xr_session_start_pre" callback for creating actions at
  appropriate point in the XR session.
- Creation of name-identifiable action sets/actions.
- Binding of actions to controller inputs.
- Acquisition of controller button states.
- Acquisition of controller poses.
- Application of controller haptic feedback.
- Carefully designed error handling and useful error reporting
  (e.g. action set/action name included in error message).

Reviewed By: Julian Eisel

Differential Revision: http://developer.blender.org/D10942
2021-05-16 03:36:31 +09:00
Campbell Barton
1151adf62d Cleanup: unnecessary extra lines for doxy sections 2021-05-11 16:04:03 +10:00
Campbell Barton
efc6f4675d Cleanup: spelling 2021-05-06 08:09:05 +10:00
Campbell Barton
832f7170dc Cleanup: link directly to stackexchange URL 2021-05-06 08:08:12 +10:00
Campbell Barton
888a697e24 Cleanup: spelling 2021-05-04 00:44:53 +10:00
Campbell Barton
3e4863376e Cleanup: use boolean for has_event variable & return value 2021-05-04 00:17:45 +10:00
Harley Acheson
c037a02096 Win32: Fix fullscreen errors using Taskbar system menu
Changing window state using taskbar system menu could result in a titleless window.

Differential Revision: https://developer.blender.org/D10812

Reviewed by Ray Molenkamp
2021-04-12 07:52:14 -07:00