mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 01:20:42 -05:00
window: Return -1 if meta_window_get_monitor is called on an unmanaged window
As opposed to crashing. In this case, letting the caller deal with it is the best policy, since this is public API. https://bugzilla.gnome.org/show_bug.cgi?id=788834
This commit is contained in:
parent
768ec15ea0
commit
8626c69c2f
@ -3750,11 +3750,15 @@ maybe_move_attached_dialog (MetaWindow *window,
|
|||||||
*
|
*
|
||||||
* Gets index of the monitor that this window is on.
|
* Gets index of the monitor that this window is on.
|
||||||
*
|
*
|
||||||
* Return Value: The index of the monitor in the screens monitor list
|
* Return Value: The index of the monitor in the screens monitor list, or -1
|
||||||
|
* if the window has been recently unmanaged and does not have a monitor.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
meta_window_get_monitor (MetaWindow *window)
|
meta_window_get_monitor (MetaWindow *window)
|
||||||
{
|
{
|
||||||
|
if (!window->monitor)
|
||||||
|
return -1;
|
||||||
|
|
||||||
return window->monitor->number;
|
return window->monitor->number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user