Commit 5ece7a8d authored by Michael Natterer's avatar Michael Natterer 😴

Port a lot of stuff from GdkScreen/monitor_number to GdkMonitor

including some fixes for getting pointer coords, and needed
API changes in libgimpwidgets.
parent 7bd6734a
......@@ -118,8 +118,7 @@ buffers_paste_as_new_image_cmd_callback (GtkAction *action,
GIMP_OBJECT (buffer));
gimp_create_display (context->gimp, new_image,
GIMP_UNIT_PIXEL, 1.0,
G_OBJECT (gtk_widget_get_screen (widget)),
gimp_widget_get_monitor (widget));
G_OBJECT (gimp_widget_get_monitor (widget)));
g_object_unref (new_image);
}
}
......
......@@ -79,8 +79,7 @@ data_open_as_image_cmd_callback (GtkAction *action,
image = file_open_with_display (context->gimp, context, NULL,
file, FALSE,
G_OBJECT (gtk_widget_get_screen (widget)),
gimp_widget_get_monitor (widget),
G_OBJECT (gimp_widget_get_monitor (widget)),
&status, &error);
if (! image && status != GIMP_PDB_CANCEL)
......@@ -278,15 +277,13 @@ data_edit_cmd_callback (GtkAction *action,
if (data && gimp_data_factory_view_have (view, GIMP_OBJECT (data)))
{
GdkScreen *screen = gtk_widget_get_screen (GTK_WIDGET (view));
gint monitor = gimp_widget_get_monitor (GTK_WIDGET (view));
GtkWidget *dockable;
GdkMonitor *monitor = gimp_widget_get_monitor (GTK_WIDGET (view));
GtkWidget *dockable;
dockable =
gimp_window_strategy_show_dockable_dialog (GIMP_WINDOW_STRATEGY (gimp_get_window_strategy (context->gimp)),
context->gimp,
gimp_dialog_factory_get_singleton (),
screen,
monitor,
value);
......
......@@ -46,7 +46,6 @@ dialogs_create_toplevel_cmd_callback (GtkAction *action,
if (value)
gimp_dialog_factory_dialog_new (gimp_dialog_factory_get_singleton (),
gtk_widget_get_screen (widget),
gimp_widget_get_monitor (widget),
NULL /*ui_manager*/,
value, -1, TRUE);
......@@ -66,7 +65,6 @@ dialogs_create_dockable_cmd_callback (GtkAction *action,
gimp_window_strategy_show_dockable_dialog (GIMP_WINDOW_STRATEGY (gimp_get_window_strategy (gimp)),
gimp,
gimp_dialog_factory_get_singleton (),
gtk_widget_get_screen (widget),
gimp_widget_get_monitor (widget),
value);
}
......@@ -373,8 +373,7 @@ documents_open_image (GtkWidget *editor,
file = gimp_imagefile_get_file (imagefile);
image = file_open_with_display (context->gimp, context, NULL, file, FALSE,
G_OBJECT (gtk_widget_get_screen (editor)),
gimp_widget_get_monitor (editor),
G_OBJECT (gimp_widget_get_monitor (editor)),
&status, &error);
if (! image && status != GIMP_PDB_CANCEL)
......
......@@ -384,8 +384,7 @@ edit_paste_as_new_image_cmd_callback (GtkAction *action,
if (image)
{
gimp_create_display (gimp, image, GIMP_UNIT_PIXEL, 1.0,
G_OBJECT (gtk_widget_get_screen (widget)),
gimp_widget_get_monitor (widget));
G_OBJECT (gimp_widget_get_monitor (widget)));
g_object_unref (image);
}
else
......@@ -468,7 +467,6 @@ edit_named_paste_cmd_callback (GtkAction *action,
gimp_window_strategy_show_dockable_dialog (GIMP_WINDOW_STRATEGY (gimp_get_window_strategy (gimp)),
gimp,
gimp_dialog_factory_get_singleton (),
gtk_widget_get_screen (widget),
gimp_widget_get_monitor (widget),
"gimp-buffer-list|gimp-buffer-grid");
}
......
......@@ -148,7 +148,6 @@ file_open_location_cmd_callback (GtkAction *action,
return_if_no_widget (widget, data);
gimp_dialog_factory_dialog_new (gimp_dialog_factory_get_singleton (),
gtk_widget_get_screen (widget),
gimp_widget_get_monitor (widget),
NULL /*ui_manager*/,
"gimp-file-open-location-dialog", -1, TRUE);
......@@ -195,8 +194,7 @@ file_open_recent_cmd_callback (GtkAction *action,
image = file_open_with_display (gimp, action_data_get_context (data),
progress,
file, FALSE,
G_OBJECT (gtk_widget_get_screen (widget)),
gimp_widget_get_monitor (widget),
G_OBJECT (gimp_widget_get_monitor (widget)),
&status, &error);
if (! image && status != GIMP_PDB_CANCEL)
......@@ -464,7 +462,6 @@ file_close_all_cmd_callback (GtkAction *action,
return_if_no_widget (widget, data);
gimp_dialog_factory_dialog_raise (gimp_dialog_factory_get_singleton (),
gtk_widget_get_screen (widget),
gimp_widget_get_monitor (widget),
"gimp-close-all-dialog", -1);
}
......@@ -557,7 +554,6 @@ file_open_dialog_show (Gimp *gimp,
GtkWidget *dialog;
dialog = gimp_dialog_factory_dialog_new (gimp_dialog_factory_get_singleton (),
gtk_widget_get_screen (parent),
gimp_widget_get_monitor (parent),
NULL /*ui_manager*/,
"gimp-file-open-dialog", -1, FALSE);
......@@ -611,7 +607,6 @@ file_save_dialog_show (Gimp *gimp,
if (! dialog)
{
dialog = gimp_dialog_factory_dialog_new (gimp_dialog_factory_get_singleton (),
gtk_widget_get_screen (parent),
gimp_widget_get_monitor (parent),
NULL /*ui_manager*/,
"gimp-file-save-dialog",
......@@ -693,7 +688,6 @@ file_export_dialog_show (Gimp *gimp,
if (! dialog)
{
dialog = gimp_dialog_factory_dialog_new (gimp_dialog_factory_get_singleton (),
gtk_widget_get_screen (parent),
gimp_widget_get_monitor (parent),
NULL /*ui_manager*/,
"gimp-file-export-dialog",
......
......@@ -188,7 +188,6 @@ image_new_cmd_callback (GtkAction *action,
return_if_no_widget (widget, data);
dialog = gimp_dialog_factory_dialog_new (gimp_dialog_factory_get_singleton (),
gtk_widget_get_screen (widget),
gimp_widget_get_monitor (widget),
NULL /*ui_manager*/,
"gimp-image-new-dialog", -1, FALSE);
......@@ -220,8 +219,7 @@ image_duplicate_cmd_callback (GtkAction *action,
gimp_create_display (new_image->gimp, new_image, shell->unit,
gimp_zoom_model_get_factor (shell->zoom),
G_OBJECT (gtk_widget_get_screen (GTK_WIDGET (shell))),
gimp_widget_get_monitor (GTK_WIDGET (shell)));
G_OBJECT (gimp_widget_get_monitor (GTK_WIDGET (shell))));
g_object_unref (new_image);
}
......
......@@ -87,8 +87,7 @@ images_new_view_cmd_callback (GtkAction *action,
if (image && gimp_container_have (container, GIMP_OBJECT (image)))
{
gimp_create_display (image->gimp, image, GIMP_UNIT_PIXEL, 1.0,
G_OBJECT (gtk_widget_get_screen (GTK_WIDGET (editor))),
gimp_widget_get_monitor (GTK_WIDGET (editor)));
G_OBJECT (gimp_widget_get_monitor (GTK_WIDGET (editor))));
}
}
......
......@@ -61,7 +61,6 @@ palettes_import_cmd_callback (GtkAction *action,
return_if_no_widget (widget, data);
gimp_dialog_factory_dialog_new (gimp_dialog_factory_get_singleton (),
gtk_widget_get_screen (widget),
gimp_widget_get_monitor (widget),
NULL /*ui_manager*/,
"gimp-palette-import-dialog", -1, TRUE);
......
......@@ -405,7 +405,6 @@ select_save_cmd_callback (GtkAction *action,
gimp_window_strategy_show_dockable_dialog (GIMP_WINDOW_STRATEGY (gimp_get_window_strategy (image->gimp)),
image->gimp,
gimp_dialog_factory_get_singleton (),
gtk_widget_get_screen (widget),
gimp_widget_get_monitor (widget),
"gimp-channel-list");
}
......
......@@ -102,8 +102,7 @@ templates_create_image_cmd_callback (GtkAction *action,
image = gimp_image_new_from_template (gimp, template, context);
gimp_create_display (gimp, image, gimp_template_get_unit (template), 1.0,
G_OBJECT (gtk_widget_get_screen (widget)),
gimp_widget_get_monitor (widget));
G_OBJECT (gimp_widget_get_monitor (widget)));
g_object_unref (image);
gimp_image_new_set_last_template (gimp, template);
......
......@@ -244,7 +244,6 @@ tool_options_show_preset_editor (Gimp *gimp,
gimp_window_strategy_show_dockable_dialog (GIMP_WINDOW_STRATEGY (gimp_get_window_strategy (gimp)),
gimp,
gimp_dialog_factory_get_singleton (),
gtk_widget_get_screen (GTK_WIDGET (editor)),
gimp_widget_get_monitor (GTK_WIDGET (editor)),
"gimp-tool-preset-editor");
......
......@@ -104,8 +104,7 @@ view_new_cmd_callback (GtkAction *action,
gimp_create_display (display->gimp,
gimp_display_get_image (display),
shell->unit, gimp_zoom_model_get_factor (shell->zoom),
G_OBJECT (gtk_widget_get_screen (GTK_WIDGET (shell))),
gimp_widget_get_monitor (GTK_WIDGET (shell)));
G_OBJECT (gimp_widget_get_monitor (GTK_WIDGET (shell))));
}
void
......@@ -483,7 +482,6 @@ view_navigation_window_cmd_callback (GtkAction *action,
gimp_window_strategy_show_dockable_dialog (GIMP_WINDOW_STRATEGY (gimp_get_window_strategy (gimp)),
gimp,
gimp_dialog_factory_get_singleton (),
gtk_widget_get_screen (GTK_WIDGET (shell)),
gimp_widget_get_monitor (GTK_WIDGET (shell)),
"gimp-navigation-view");
}
......
......@@ -193,7 +193,6 @@ windows_open_recent_cmd_callback (GtkAction *action,
info);
gimp_session_info_restore (info, gimp_dialog_factory_get_singleton (),
gtk_widget_get_screen (widget),
gimp_widget_get_monitor (widget));
g_object_unref (info);
......
......@@ -94,8 +94,7 @@ GType gimp_convert_dither_type_compat_get_type (void); /* compat cruft */
/* local variables */
static GObject *initial_screen = NULL;
static gint initial_monitor = 0;
static GObject *initial_monitor = NULL;
/* public functions */
......@@ -372,7 +371,6 @@ app_run (const gchar *full_prog_name,
gimp_get_user_context (gimp),
NULL,
file, as_new,
initial_screen,
initial_monitor,
&status, &error);
if (image)
......@@ -415,7 +413,6 @@ app_run (const gchar *full_prog_name,
GFile *file = g_file_new_for_commandline_arg (filenames[i]);
file_open_from_command_line (gimp, file, as_new,
initial_screen,
initial_monitor);
g_object_unref (file);
......@@ -471,12 +468,14 @@ static void
app_restore_after_callback (Gimp *gimp,
GimpInitStatusFunc status_callback)
{
gint dummy;
/* Getting the display name for a -1 display returns the initial
* monitor during startup. Need to call this from a restore_after
* callback, because before restore(), the GUI can't return anything,
* after after restore() the initial monitor gets reset.
*/
g_free (gimp_get_display_name (gimp, -1, &initial_screen, &initial_monitor));
g_free (gimp_get_display_name (gimp, -1, &initial_monitor, &dummy));
}
static gboolean
......
......@@ -219,18 +219,18 @@ gimp_get_program_class (Gimp *gimp)
gchar *
gimp_get_display_name (Gimp *gimp,
gint display_ID,
GObject **screen,
gint *monitor)
GObject **monitor,
gint *monitor_number)
{
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
g_return_val_if_fail (screen != NULL, NULL);
g_return_val_if_fail (monitor != NULL, NULL);
g_return_val_if_fail (monitor_number != NULL, NULL);
if (gimp->gui.get_display_name)
return gimp->gui.get_display_name (gimp, display_ID, screen, monitor);
return gimp->gui.get_display_name (gimp, display_ID,
monitor, monitor_number);
*screen = NULL;
*monitor = 0;
*monitor = NULL;
return NULL;
}
......@@ -343,15 +343,14 @@ gimp_create_display (Gimp *gimp,
GimpImage *image,
GimpUnit unit,
gdouble scale,
GObject *screen,
gint monitor)
GObject *monitor)
{
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
g_return_val_if_fail (image == NULL || GIMP_IS_IMAGE (image), NULL);
g_return_val_if_fail (screen == NULL || G_IS_OBJECT (screen), NULL);
g_return_val_if_fail (monitor == NULL || G_IS_OBJECT (monitor), NULL);
if (gimp->gui.display_create)
return gimp->gui.display_create (gimp, image, unit, scale, screen, monitor);
return gimp->gui.display_create (gimp, image, unit, scale, monitor);
return NULL;
}
......
......@@ -44,8 +44,8 @@ struct _GimpGui
const gchar * (* get_program_class) (Gimp *gimp);
gchar * (* get_display_name) (Gimp *gimp,
gint display_ID,
GObject **screen,
gint *monitor);
GObject **monitor,
gint *monitor_number);
guint32 (* get_user_time) (Gimp *gimp);
GFile * (* get_theme_dir) (Gimp *gimp);
......@@ -61,8 +61,7 @@ struct _GimpGui
GimpImage *image,
GimpUnit unit,
gdouble scale,
GObject *screen,
gint monitor);
GObject *monitor);
void (* display_delete) (GimpObject *display);
void (* displays_reconnect) (Gimp *gimp,
GimpImage *old_image,
......@@ -128,8 +127,7 @@ GimpObject * gimp_create_display (Gimp *gimp,
GimpImage *image,
GimpUnit unit,
gdouble scale,
GObject *screen,
gint monitor);
GObject *monitor);
void gimp_delete_display (Gimp *gimp,
GimpObject *display);
void gimp_reconnect_displays (Gimp *gimp,
......@@ -158,8 +156,8 @@ void gimp_free_progress (Gimp *gimp,
const gchar * gimp_get_program_class (Gimp *gimp);
gchar * gimp_get_display_name (Gimp *gimp,
gint display_ID,
GObject **screen,
gint *monitor);
GObject **monitor,
gint *monitor_number);
guint32 gimp_get_user_time (Gimp *gimp);
GFile * gimp_get_theme_dir (Gimp *gimp);
GFile * gimp_get_icon_theme_dir (Gimp *gimp);
......
......@@ -211,12 +211,10 @@ GimpContainer *global_recent_docks = NULL;
static GtkWidget * dialogs_restore_dialog (GimpDialogFactory *factory,
GdkScreen *screen,
gint monitor,
GdkMonitor *monitor,
GimpSessionInfo *info);
static GtkWidget * dialogs_restore_window (GimpDialogFactory *factory,
GdkScreen *screen,
gint monitor,
GdkMonitor *monitor,
GimpSessionInfo *info);
......@@ -448,7 +446,6 @@ static const GimpDialogFactoryEntry entries[] =
* dialogs_restore_dialog:
* @factory:
* @screen:
* @monitor:
* @info:
*
* Creates a top level widget based on the given session info object
......@@ -459,8 +456,7 @@ static const GimpDialogFactoryEntry entries[] =
**/
static GtkWidget *
dialogs_restore_dialog (GimpDialogFactory *factory,
GdkScreen *screen,
gint monitor,
GdkMonitor *monitor,
GimpSessionInfo *info)
{
GtkWidget *dialog;
......@@ -471,7 +467,7 @@ dialogs_restore_dialog (GimpDialogFactory *factory,
info);
dialog =
gimp_dialog_factory_dialog_new (factory, screen, monitor,
gimp_dialog_factory_dialog_new (factory, monitor,
NULL /*ui_manager*/,
gimp_session_info_get_factory_entry (info)->identifier,
gimp_session_info_get_factory_entry (info)->view_size,
......@@ -488,7 +484,6 @@ dialogs_restore_dialog (GimpDialogFactory *factory,
/**
* dialogs_restore_window:
* @factory:
* @screen:
* @monitor:
* @info:
*
......@@ -500,8 +495,7 @@ dialogs_restore_dialog (GimpDialogFactory *factory,
**/
static GtkWidget *
dialogs_restore_window (GimpDialogFactory *factory,
GdkScreen *screen,
gint monitor,
GdkMonitor *monitor,
GimpSessionInfo *info)
{
Gimp *gimp = gimp_dialog_factory_get_context (factory)->gimp;
......
......@@ -202,8 +202,7 @@ file_open_dialog_open_image (GtkWidget *dialog,
GIMP_PROGRESS (dialog),
file, file, FALSE,
load_proc,
G_OBJECT (gtk_widget_get_screen (dialog)),
gimp_widget_get_monitor (dialog),
G_OBJECT (gimp_widget_get_monitor (dialog)),
&status, &error);
if (! image && status != GIMP_PDB_CANCEL)
......
......@@ -208,8 +208,7 @@ file_open_location_response (GtkDialog *dialog,
GIMP_PROGRESS (box),
file, entered_file,
FALSE, NULL,
G_OBJECT (gtk_widget_get_screen (entry)),
gimp_widget_get_monitor (entry),
G_OBJECT (gimp_widget_get_monitor (entry)),
&status, &error);
gtk_dialog_set_response_sensitive (dialog, GTK_RESPONSE_OK, TRUE);
......
......@@ -368,8 +368,7 @@ image_new_create_image (ImageNewDialog *private)
image = gimp_image_new_from_template (gimp, template,
gimp_get_user_context (gimp));
gimp_create_display (gimp, image, gimp_template_get_unit (template), 1.0,
G_OBJECT (gtk_widget_get_screen (private->dialog)),
gimp_widget_get_monitor (private->dialog));
G_OBJECT (gimp_widget_get_monitor (private->dialog)));
g_object_unref (image);
gtk_widget_destroy (private->dialog);
......
......@@ -528,8 +528,7 @@ prefs_resolution_source_callback (GtkWidget *widget,
if (from_gdk)
{
gimp_get_monitor_resolution (gtk_widget_get_screen (widget),
gimp_widget_get_monitor (widget),
gimp_get_monitor_resolution (gimp_widget_get_monitor (widget),
&xres, &yres);
}
else
......@@ -571,7 +570,6 @@ prefs_input_devices_dialog (GtkWidget *widget,
Gimp *gimp)
{
gimp_dialog_factory_dialog_raise (gimp_dialog_factory_get_singleton (),
gtk_widget_get_screen (widget),
gimp_widget_get_monitor (widget),
"gimp-input-devices-dialog", 0);
}
......@@ -581,7 +579,6 @@ prefs_keyboard_shortcuts_dialog (GtkWidget *widget,
Gimp *gimp)
{
gimp_dialog_factory_dialog_raise (gimp_dialog_factory_get_singleton (),
gtk_widget_get_screen (widget),
gimp_widget_get_monitor (widget),
"gimp-keyboard-shortcuts-dialog", 0);
}
......@@ -2592,8 +2589,7 @@ prefs_dialog_new (Gimp *gimp,
gdouble yres;
gchar *str;
gimp_get_monitor_resolution (gdk_screen_get_default (), /* FIXME monitor */
0, /* FIXME monitor */
gimp_get_monitor_resolution (gdk_display_get_monitor (gdk_display_get_default (), 0),
&xres, &yres);
str = g_strdup_printf (_("_Detect automatically (currently %d × %d ppi)"),
......
......@@ -389,8 +389,7 @@ gimp_display_new (Gimp *gimp,
gdouble scale,
GimpUIManager *popup_manager,
GimpDialogFactory *dialog_factory,
GdkScreen *screen,
gint monitor)
GdkMonitor *monitor)
{
GimpDisplay *display;
GimpDisplayPrivate *private;
......@@ -399,7 +398,7 @@ gimp_display_new (Gimp *gimp,
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
g_return_val_if_fail (image == NULL || GIMP_IS_IMAGE (image), NULL);
g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
g_return_val_if_fail (GDK_IS_MONITOR (monitor), NULL);
/* If there isn't an interface, never create a display */
if (gimp->no_interface)
......@@ -441,14 +440,12 @@ gimp_display_new (Gimp *gimp,
window = gimp_image_window_new (gimp,
private->image,
dialog_factory,
screen,
monitor);
}
/* create the shell for the image */
private->shell = gimp_display_shell_new (display, unit, scale,
popup_manager,
screen,
monitor);
shell = gimp_display_get_shell (display);
......
......@@ -55,8 +55,7 @@ GimpDisplay * gimp_display_new (Gimp *gimp,
gdouble scale,
GimpUIManager *popup_manager,
GimpDialogFactory *dialog_factory,
GdkScreen *screen,
gint monitor);
GdkMonitor *monitor);
void gimp_display_delete (GimpDisplay *display);
void gimp_display_close (GimpDisplay *display);
......
......@@ -225,8 +225,7 @@ gimp_display_shell_drop_drawable (GtkWidget *widget,
image = gimp_image_new_from_drawable (shell->display->gimp,
GIMP_DRAWABLE (viewable));
gimp_create_display (shell->display->gimp, image, GIMP_UNIT_PIXEL, 1.0,
G_OBJECT (gtk_widget_get_screen (widget)),
gimp_widget_get_monitor (widget));
G_OBJECT (gimp_widget_get_monitor (widget)));
g_object_unref (image);
return;
......@@ -460,8 +459,7 @@ gimp_display_shell_drop_buffer (GtkWidget *widget,
image = gimp_image_new_from_buffer (shell->display->gimp,
GIMP_BUFFER (viewable));
gimp_create_display (image->gimp, image, GIMP_UNIT_PIXEL, 1.0,
G_OBJECT (gtk_widget_get_screen (widget)),
gimp_widget_get_monitor (widget));
G_OBJECT (gimp_widget_get_monitor (widget)));
g_object_unref (image);
return;
......@@ -584,8 +582,7 @@ gimp_display_shell_drop_uri_list (GtkWidget *widget,
new_image = file_open_with_display (shell->display->gimp, context,
NULL,
file, FALSE,
G_OBJECT (gtk_widget_get_screen (widget)),
gimp_widget_get_monitor (widget),
G_OBJECT (gimp_widget_get_monitor (widget)),
&status, &error);
if (! new_image && status != GIMP_PDB_CANCEL)
......@@ -597,8 +594,7 @@ gimp_display_shell_drop_uri_list (GtkWidget *widget,
image = file_open_with_display (shell->display->gimp, context,
GIMP_PROGRESS (shell->display),
file, FALSE,
G_OBJECT (gtk_widget_get_screen (widget)),
gimp_widget_get_monitor (widget),
G_OBJECT (gimp_widget_get_monitor (widget)),
&status, &error);
if (! image && status != GIMP_PDB_CANCEL)
......@@ -648,8 +644,7 @@ gimp_display_shell_drop_component (GtkWidget *widget,
dest_image = gimp_image_new_from_component (image->gimp,
image, component);
gimp_create_display (dest_image->gimp, dest_image, GIMP_UNIT_PIXEL, 1.0,
G_OBJECT (gtk_widget_get_screen (widget)),
gimp_widget_get_monitor (widget));
G_OBJECT (gimp_widget_get_monitor (widget)));
g_object_unref (dest_image);
return;
......@@ -706,8 +701,7 @@ gimp_display_shell_drop_pixbuf (GtkWidget *widget,
image = gimp_image_new_from_pixbuf (shell->display->gimp, pixbuf,
_("Dropped Buffer"));
gimp_create_display (image->gimp, image, GIMP_UNIT_PIXEL, 1.0,
G_OBJECT (gtk_widget_get_screen (widget)),
gimp_widget_get_monitor (widget));
G_OBJECT (gimp_widget_get_monitor (widget)));
g_object_unref (image);
return;
......
......@@ -1017,8 +1017,7 @@ gimp_display_shell_monitor_res_notify_handler (GObject *config,
{
if (GIMP_DISPLAY_CONFIG (config)->monitor_res_from_gdk)
{
gimp_get_monitor_resolution (gtk_widget_get_screen (GTK_WIDGET (shell)),
gimp_widget_get_monitor (GTK_WIDGET (shell)),
gimp_get_monitor_resolution (gimp_widget_get_monitor (GTK_WIDGET (shell)),
&shell->monitor_xres,
&shell->monitor_yres);
}
......
......@@ -92,7 +92,6 @@ enum
{
PROP_0,
PROP_POPUP_MANAGER,
PROP_INITIAL_SCREEN,
PROP_INITIAL_MONITOR,
PROP_DISPLAY,
PROP_UNIT,
......@@ -259,20 +258,13 @@ gimp_display_shell_class_init (GimpDisplayShellClass *klass)
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property (object_class, PROP_INITIAL_SCREEN,
g_param_spec_object ("initial-screen",
g_object_class_install_property (object_class, PROP_INITIAL_MONITOR,
g_param_spec_object ("initial-monitor",
NULL, NULL,
GDK_TYPE_SCREEN,
GDK_TYPE_MONITOR,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property (object_class, PROP_INITIAL_MONITOR,
g_param_spec_int ("initial-monitor",
NULL, NULL,
0, 16, 0,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property (object_class, PROP_DISPLAY,
g_param_spec_object ("display", NULL, NULL,
GIMP_TYPE_DISPLAY,
......@@ -424,8 +416,7 @@ gimp_display_shell_constructed (GObject *object)
if (config->monitor_res_from_gdk)
{
gimp_get_monitor_resolution (shell->initial_screen,
shell->initial_monitor,
gimp_get_monitor_resolution (shell->initial_monitor,
&shell->monitor_xres, &shell->monitor_yres);
}
else
......@@ -895,11 +886,8 @@ gimp_display_shell_set_property (GObject *object,
case PROP_POPUP_MANAGER:
shell->popup_manager = g_value_get_object (value);
break;
case PROP_INITIAL_SCREEN:
shell->initial_screen = g_value_get_object (value);
break;
case PROP_INITIAL_MONITOR:
shell->initial_monitor = g_value_get_int (value);
shell->initial_monitor = g_value_get_object (value);
break;
case PROP_DISPLAY:
shell->display = g_value_get_object (value);
......@@ -940,11 +928,8 @@ gimp_display_shell_get_property (GObject *object,
case PROP_POPUP_MANAGER:
g_value_set_object (value, shell->popup_manager);
break;
case PROP_INITIAL_SCREEN:
g_value_set_object (value, shell->initial_screen);
break;
case PROP_INITIAL_MONITOR:
g_value_set_int (value, shell->initial_monitor);
g_value_set_object (value, shell->initial_monitor);
break;
case PROP_DISPLAY:
g_value_set_object (value, shell->display);
......@@ -990,8 +975,7 @@ gimp_display_shell_screen_changed (GtkWidget *widget,
if (shell->display->config->monitor_res_from_gdk)
{
gimp_get_monitor_resolution (gtk_widget_get_screen (widget),
gimp_widget_get_monitor (widget),
gimp_get_monitor_resolution (gimp_widget_get_monitor (widget),
&shell->monitor_xres,
&shell->monitor_yres);
}
......@@ -1245,16 +1229,14 @@ gimp_display_shell_new (GimpDisplay *display,
GimpUnit unit,
gdouble scale,
GimpUIManager *popup_manager,
GdkScreen *screen,
gint monitor)
GdkMonitor *monitor)
{
g_return_val_if_fail (GIMP_IS_DISPLAY (display), NULL);
g_return_val_if_fail (GIMP_IS_UI_MANAGER (popup_manager), NULL);
g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
g_return_val_if_fail (GDK_IS_MONITOR (monitor), NULL);
return g_object_new (GIMP_TYPE_DISPLAY_SHELL,
"popup-manager", popup_manager,
"initial-screen", screen,
"initial-monitor", monitor,
"display", display,
"unit", unit,
......
......@@ -52,8 +52,7 @@ struct _GimpDisplayShell
GimpDisplay *display;
GimpUIManager *popup_manager;
GdkScreen *initial_screen;
gint initial_monitor;
GdkMonitor *initial_monitor;