diff options
author | Julian Eisel <eiseljulian@gmail.com> | 2019-10-03 17:59:49 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2019-10-03 18:50:27 +0300 |
commit | edffb0e9b19db62323b09ea93ce8f234f133656e (patch) | |
tree | 93299747b13308ff9b7aa1a9ed8ba56d3c41049c /intern/ghost/GHOST_C-api.h | |
parent | 35ae1da16c6aab293adbe1e4eecba624006a085c (diff) |
UI: Register File Browser as Child/Dialog-Window for the OS
For many users, this will make the File Browser window behave more like
what they would expect. It addresses the issue of the File Browser
becoming hidden behind the main window by clicking anywhere in the
latter. It communicates the interruptive, but temporary nature of the
operation a bit better.
Further, on tiling window managers the File Browser now opens as
floating by default, like in other applications.
Note that this also makes sure the File Browser is always opened as
separate window, so it doesn't re-use the Preferences, or any other
temporary window anymore. This seems to have been a common annoyance.
More concretely, this makes the File Browser window behave as follows:
* Stays on top of its parent Blender window, but not on top of
non-Blender windows.
* Minimizes with its parent window
* Can be moved independently
* Doesn't add an own item in task bars
* Doesn't block other Blender windows (we may want to have this though)
* Opens as floating window for tiling window managers (e.g. i3wm/Sway)
Further notes:
* When opening a file browser from the Preference window (or any
temporary window), the main window, as the file browsers parent is
moved on top of the Preferences, which makes it seem like the
Preferences were closed. This is the general issue of bad secondary
window handling as window activation changes. I made it so that the
window is moved back once the file browser is closed.
This behavior is confusing and would be nice to avoid. It's a separate
issue though.
* On most window managers on Linux the temporary window can not be
minimized and maximized, they disable that for dialog windows.
* On Windows and macOS, only minimizing is disabled, as there is no
decent way yet to restore a window if it's not shown in the taskbar.
Reviewed By: Brecht van Lommel, Campbell Barton, William Reynish
Edits and macOS implementation by Brecht.
Differential Revision: https://developer.blender.org/D5810
Part of T69652.
Diffstat (limited to 'intern/ghost/GHOST_C-api.h')
-rw-r--r-- | intern/ghost/GHOST_C-api.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/intern/ghost/GHOST_C-api.h b/intern/ghost/GHOST_C-api.h index 20bb144a924..220e7aab8cd 100644 --- a/intern/ghost/GHOST_C-api.h +++ b/intern/ghost/GHOST_C-api.h @@ -176,6 +176,17 @@ extern GHOST_WindowHandle GHOST_CreateWindow(GHOST_SystemHandle systemhandle, GHOST_TDrawingContextType type, GHOST_GLSettings glSettings); +extern GHOST_WindowHandle GHOST_CreateDialogWindow(GHOST_SystemHandle systemhandle, + GHOST_WindowHandle parent_windowhandle, + const char *title, + GHOST_TInt32 left, + GHOST_TInt32 top, + GHOST_TUns32 width, + GHOST_TUns32 height, + GHOST_TWindowState state, + GHOST_TDrawingContextType type, + GHOST_GLSettings glSettings); + /** * Create a new offscreen context. * Never explicitly delete the context, use disposeContext() instead. @@ -207,6 +218,8 @@ extern GHOST_TUserDataPtr GHOST_GetWindowUserData(GHOST_WindowHandle windowhandl */ extern void GHOST_SetWindowUserData(GHOST_WindowHandle windowhandle, GHOST_TUserDataPtr userdata); +extern int GHOST_IsDialogWindow(GHOST_WindowHandle windowhandle); + /** * Dispose a window. * \param systemhandle The handle to the system |