app: make things behave more reasonable with multiple monitors
There is now a preference option that determines whether windows should be opened on the same monitor as before. It should be disabled when the machine gets monitors plugged/unplugged dynamically ("laptop") and enabled when there is a static multi-monitor setup ("wokstation"). This is merely the current simplistic policy on top of the newly added underlying infrastructure: - pass integer monitor numbers around in all places where we already pass around a GdkScreen. Pass the "current" monitor to these changed APIs, where "current" is either the monitor where the action-triggering widget is, or if that is unavailable the monitor where the mouse is. - add gimp_widget_get_monitor() in order to easily get to the monitor, just like gtk_widget_get_screen(). - add screen and monitor parameters in some places that were missed before. - in sessionrc, save all window positions relative to the window's monitor, and save the monitor separately, if it's not the screen's primary monitor. - when restoring window positions, use the stored monitor when the new prefs options says so (use the screen's primary monitor if there is no stored monitor), otherwise use current monitor that is now passed around.
This commit is contained in:
@ -44,6 +44,7 @@ static GtkWidget * gimp_single_window_strategy_show_dockable_dialog (GimpW
|
||||
Gimp *gimp,
|
||||
GimpDialogFactory *factory,
|
||||
GdkScreen *screen,
|
||||
gint monitor,
|
||||
const gchar *identifiers);
|
||||
|
||||
|
||||
@ -75,6 +76,7 @@ gimp_single_window_strategy_show_dockable_dialog (GimpWindowStrategy *strategy,
|
||||
Gimp *gimp,
|
||||
GimpDialogFactory *factory,
|
||||
GdkScreen *screen,
|
||||
gint monitor,
|
||||
const gchar *identifiers)
|
||||
{
|
||||
GList *windows = gimp_get_image_windows (gimp);
|
||||
@ -96,6 +98,7 @@ gimp_single_window_strategy_show_dockable_dialog (GimpWindowStrategy *strategy,
|
||||
|
||||
widget = gimp_dialog_factory_dialog_new (factory,
|
||||
screen,
|
||||
monitor,
|
||||
ui_manager,
|
||||
"gimp-toolbox",
|
||||
-1 /*view_size*/,
|
||||
@ -111,7 +114,8 @@ gimp_single_window_strategy_show_dockable_dialog (GimpWindowStrategy *strategy,
|
||||
else if (gimp_dialog_factory_find_widget (factory, identifiers))
|
||||
{
|
||||
/* if the dialog is already open, simply raise it */
|
||||
return gimp_dialog_factory_dialog_raise (factory, screen, identifiers, -1);
|
||||
return gimp_dialog_factory_dialog_raise (factory, screen, monitor,
|
||||
identifiers, -1);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -131,8 +135,8 @@ gimp_single_window_strategy_show_dockable_dialog (GimpWindowStrategy *strategy,
|
||||
}
|
||||
|
||||
widget = gimp_dockbook_add_from_dialog_factory (GIMP_DOCKBOOK (dockbook),
|
||||
identifiers,
|
||||
-1 /*index*/);
|
||||
identifiers,
|
||||
-1 /*index*/);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user