mirror of
https://github.com/elementary/gala.git
synced 2024-11-26 23:05:09 +03:00
WindowManager: explicitly dim and undim (#1298)
This commit is contained in:
parent
4fac2d838f
commit
e1bd8bc306
@ -722,18 +722,19 @@ namespace Gala {
|
|||||||
out x, out y);
|
out x, out y);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void toggle_dim_parent (Meta.Window window) {
|
private void dim_parent_window (Meta.Window window, bool dim) {
|
||||||
if (window.window_type == Meta.WindowType.MODAL_DIALOG) {
|
if (window.window_type == Meta.WindowType.MODAL_DIALOG) {
|
||||||
var ancestor = window.find_root_ancestor ();
|
var ancestor = window.find_root_ancestor ();
|
||||||
if (ancestor != null && ancestor != window) {
|
if (ancestor != null && ancestor != window) {
|
||||||
var win = (Meta.WindowActor) ancestor.get_compositor_private ();
|
var win = (Meta.WindowActor) ancestor.get_compositor_private ();
|
||||||
if (win.has_effects ()) {
|
// Can't rely on win.has_effects since other effects could be applied
|
||||||
win.clear_effects ();
|
if (dim) {
|
||||||
} else {
|
|
||||||
var dark_effect = new Clutter.BrightnessContrastEffect ();
|
var dark_effect = new Clutter.BrightnessContrastEffect ();
|
||||||
dark_effect.set_brightness (-0.4f);
|
dark_effect.set_brightness (-0.4f);
|
||||||
|
|
||||||
win.add_effect (dark_effect);
|
win.add_effect (dark_effect);
|
||||||
|
} else {
|
||||||
|
win.clear_effects ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1387,7 +1388,7 @@ namespace Gala {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
toggle_dim_parent (window);
|
dim_parent_window (window, true);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case Meta.WindowType.NOTIFICATION:
|
case Meta.WindowType.NOTIFICATION:
|
||||||
@ -1465,7 +1466,7 @@ namespace Gala {
|
|||||||
destroy_completed (actor);
|
destroy_completed (actor);
|
||||||
});
|
});
|
||||||
|
|
||||||
toggle_dim_parent (window);
|
dim_parent_window (window, false);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case Meta.WindowType.MENU:
|
case Meta.WindowType.MENU:
|
||||||
|
Loading…
Reference in New Issue
Block a user