Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Eisel <eiseljulian@gmail.com>2019-10-03 17:59:49 +0300
committerJulian Eisel <eiseljulian@gmail.com>2019-10-03 18:50:27 +0300
commitedffb0e9b19db62323b09ea93ce8f234f133656e (patch)
tree93299747b13308ff9b7aa1a9ed8ba56d3c41049c /source/blender/editors/screen
parent35ae1da16c6aab293adbe1e4eecba624006a085c (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 'source/blender/editors/screen')
-rw-r--r--source/blender/editors/screen/screen_edit.c5
-rw-r--r--source/blender/editors/screen/screen_ops.c33
2 files changed, 27 insertions, 11 deletions
diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c
index c8008fe3cc7..bbdddfadc30 100644
--- a/source/blender/editors/screen/screen_edit.c
+++ b/source/blender/editors/screen/screen_edit.c
@@ -1375,13 +1375,14 @@ ScrArea *ED_screen_temp_space_open(bContext *C,
int sizex,
int sizey,
eSpace_Type space_type,
- int display_type)
+ int display_type,
+ bool dialog)
{
ScrArea *sa = NULL;
switch (display_type) {
case USER_TEMP_SPACE_DISPLAY_WINDOW:
- if (WM_window_open_temp(C, title, x, y, sizex, sizey, (int)space_type)) {
+ if (WM_window_open_temp(C, title, x, y, sizex, sizey, (int)space_type, dialog)) {
sa = CTX_wm_area(C);
}
break;
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c
index 0b374617cce..866144c272d 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -4828,9 +4828,14 @@ static int userpref_show_invoke(bContext *C, wmOperator *op, const wmEvent *even
int sizey = 520 * UI_DPI_FAC;
/* changes context! */
- if (WM_window_open_temp(
- C, IFACE_("Blender Preferences"), event->x, event->y, sizex, sizey, SPACE_USERPREF) !=
- NULL) {
+ if (WM_window_open_temp(C,
+ IFACE_("Blender Preferences"),
+ event->x,
+ event->y,
+ sizex,
+ sizey,
+ SPACE_USERPREF,
+ false) != NULL) {
/* The header only contains the editor switcher and looks empty.
* So hiding in the temp window makes sense. */
ScrArea *area = CTX_wm_area(C);
@@ -4879,9 +4884,14 @@ static int drivers_editor_show_invoke(bContext *C, wmOperator *op, const wmEvent
but = UI_context_active_but_prop_get(C, &ptr, &prop, &index);
/* changes context! */
- if (WM_window_open_temp(
- C, IFACE_("Blender Drivers Editor"), event->x, event->y, sizex, sizey, SPACE_GRAPH) !=
- NULL) {
+ if (WM_window_open_temp(C,
+ IFACE_("Blender Drivers Editor"),
+ event->x,
+ event->y,
+ sizex,
+ sizey,
+ SPACE_GRAPH,
+ false) != NULL) {
ED_drivers_editor_init(C, CTX_wm_area(C));
/* activate driver F-Curve for the property under the cursor */
@@ -4939,9 +4949,14 @@ static int info_log_show_invoke(bContext *C, wmOperator *op, const wmEvent *even
int shift_y = 480;
/* changes context! */
- if (WM_window_open_temp(
- C, IFACE_("Blender Info Log"), event->x, event->y + shift_y, sizex, sizey, SPACE_INFO) !=
- NULL) {
+ if (WM_window_open_temp(C,
+ IFACE_("Blender Info Log"),
+ event->x,
+ event->y + shift_y,
+ sizex,
+ sizey,
+ SPACE_INFO,
+ false) != NULL) {
return OPERATOR_FINISHED;
}
else {