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:
@ -84,7 +84,9 @@ struct _GimpToolGuiPrivate
|
||||
static void gimp_tool_gui_dispose (GObject *object);
|
||||
static void gimp_tool_gui_finalize (GObject *object);
|
||||
|
||||
static void gimp_tool_gui_create_dialog (GimpToolGui *gui);
|
||||
static void gimp_tool_gui_create_dialog (GimpToolGui *gui,
|
||||
GdkScreen *screen,
|
||||
gint monitor);
|
||||
static void gimp_tool_gui_update_buttons (GimpToolGui *gui);
|
||||
static void gimp_tool_gui_update_shell (GimpToolGui *gui);
|
||||
static void gimp_tool_gui_update_viewable (GimpToolGui *gui);
|
||||
@ -211,6 +213,8 @@ gimp_tool_gui_finalize (GObject *object)
|
||||
GimpToolGui *
|
||||
gimp_tool_gui_new (GimpToolInfo *tool_info,
|
||||
const gchar *description,
|
||||
GdkScreen *screen,
|
||||
gint monitor,
|
||||
gboolean overlay,
|
||||
...)
|
||||
{
|
||||
@ -244,7 +248,7 @@ gimp_tool_gui_new (GimpToolInfo *tool_info,
|
||||
|
||||
va_end (args);
|
||||
|
||||
gimp_tool_gui_create_dialog (gui);
|
||||
gimp_tool_gui_create_dialog (gui, screen, monitor);
|
||||
|
||||
return gui;
|
||||
}
|
||||
@ -394,6 +398,8 @@ gimp_tool_gui_hide (GimpToolGui *gui)
|
||||
|
||||
void
|
||||
gimp_tool_gui_set_overlay (GimpToolGui *gui,
|
||||
GdkScreen *screen,
|
||||
gint monitor,
|
||||
gboolean overlay)
|
||||
{
|
||||
GimpToolGuiPrivate *private;
|
||||
@ -421,7 +427,7 @@ gimp_tool_gui_set_overlay (GimpToolGui *gui,
|
||||
|
||||
private->overlay = overlay ? TRUE : FALSE;
|
||||
|
||||
gimp_tool_gui_create_dialog (gui);
|
||||
gimp_tool_gui_create_dialog (gui, screen, monitor);
|
||||
|
||||
if (visible)
|
||||
gimp_tool_gui_show (gui);
|
||||
@ -557,7 +563,9 @@ gimp_tool_gui_set_alternative_button_order (GimpToolGui *gui,
|
||||
/* private functions */
|
||||
|
||||
static void
|
||||
gimp_tool_gui_create_dialog (GimpToolGui *gui)
|
||||
gimp_tool_gui_create_dialog (GimpToolGui *gui,
|
||||
GdkScreen *screen,
|
||||
gint monitor)
|
||||
{
|
||||
GimpToolGuiPrivate *private = GET_PRIVATE (gui);
|
||||
GList *list;
|
||||
@ -596,6 +604,7 @@ gimp_tool_gui_create_dialog (GimpToolGui *gui)
|
||||
else
|
||||
{
|
||||
private->dialog = gimp_tool_dialog_new (private->tool_info,
|
||||
screen, monitor,
|
||||
private->description,
|
||||
NULL);
|
||||
|
||||
|
Reference in New Issue
Block a user