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);
|
||||
}
|
||||
|
||||
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) {
|
||||
var ancestor = window.find_root_ancestor ();
|
||||
if (ancestor != null && ancestor != window) {
|
||||
var win = (Meta.WindowActor) ancestor.get_compositor_private ();
|
||||
if (win.has_effects ()) {
|
||||
win.clear_effects ();
|
||||
} else {
|
||||
// Can't rely on win.has_effects since other effects could be applied
|
||||
if (dim) {
|
||||
var dark_effect = new Clutter.BrightnessContrastEffect ();
|
||||
dark_effect.set_brightness (-0.4f);
|
||||
|
||||
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;
|
||||
case Meta.WindowType.NOTIFICATION:
|
||||
@ -1465,7 +1466,7 @@ namespace Gala {
|
||||
destroy_completed (actor);
|
||||
});
|
||||
|
||||
toggle_dim_parent (window);
|
||||
dim_parent_window (window, false);
|
||||
|
||||
break;
|
||||
case Meta.WindowType.MENU:
|
||||
|
Loading…
Reference in New Issue
Block a user