mirror of
https://github.com/brl/mutter.git
synced 2024-11-27 18:40:40 -05:00
window: Force update monitor on hot plugs
Commita3da4b8d5b
changed updating of window monitors to always use take affect when it was done from a non-user operation. This could cause feed back loops when a non-user driven operation would trigger the changing of a monitor, which itself would trigger changing of the monitor again due to a window scale change. The reason for the change, was that when the window monitor changed due to a hot plug, if it didn't actually change, eventually the window monitor pointer would be pointing to freed memory. Instead of force updating the monitor on all non-user operations, just do it on hot plugs. This allows for the feedback loop preventing logic to still do what its supposed to do, without risking dangling pointers on hot plugs. Related: https://gitlab.gnome.org/GNOME/mutter/issues/189 Closes: https://gitlab.gnome.org/GNOME/mutter/issues/192 (cherry picked from commit8d3e053059
)
This commit is contained in:
parent
0537907b0c
commit
8a74b269a6
@ -125,6 +125,7 @@ typedef enum _MetaWindowUpdateMonitorFlags
|
|||||||
{
|
{
|
||||||
META_WINDOW_UPDATE_MONITOR_FLAGS_NONE = 0,
|
META_WINDOW_UPDATE_MONITOR_FLAGS_NONE = 0,
|
||||||
META_WINDOW_UPDATE_MONITOR_FLAGS_USER_OP = 1 << 0,
|
META_WINDOW_UPDATE_MONITOR_FLAGS_USER_OP = 1 << 0,
|
||||||
|
META_WINDOW_UPDATE_MONITOR_FLAGS_FORCE = 1 << 1,
|
||||||
} MetaWindowUpdateMonitorFlags;
|
} MetaWindowUpdateMonitorFlags;
|
||||||
|
|
||||||
typedef struct _MetaPlacementRule
|
typedef struct _MetaPlacementRule
|
||||||
|
@ -3803,7 +3803,7 @@ meta_window_update_for_monitors_changed (MetaWindow *window)
|
|||||||
if (window->override_redirect || window->type == META_WINDOW_DESKTOP)
|
if (window->override_redirect || window->type == META_WINDOW_DESKTOP)
|
||||||
{
|
{
|
||||||
meta_window_update_monitor (window,
|
meta_window_update_monitor (window,
|
||||||
META_WINDOW_UPDATE_MONITOR_FLAGS_NONE);
|
META_WINDOW_UPDATE_MONITOR_FLAGS_FORCE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3839,7 +3839,7 @@ meta_window_update_for_monitors_changed (MetaWindow *window)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
meta_window_update_monitor (window,
|
meta_window_update_monitor (window,
|
||||||
META_WINDOW_UPDATE_MONITOR_FLAGS_NONE);
|
META_WINDOW_UPDATE_MONITOR_FLAGS_FORCE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user