mirror of https://github.com/GNOME/gimp.git
app: make sure the GUI appears on the same monitor as the splash
Manually figure the monitor where the pointer is and pass it to the splash, the empty image window and to session_restore() explicly.
This commit is contained in:
parent
4bb63322d7
commit
62257edb3e
|
@ -140,6 +140,8 @@ static void gui_display_changed (GimpContext *context,
|
|||
static Gimp *the_gui_gimp = NULL;
|
||||
static GimpUIManager *image_ui_manager = NULL;
|
||||
static GimpUIConfigurer *ui_configurer = NULL;
|
||||
static GdkScreen *initial_screen = NULL;
|
||||
static gint initial_monitor = 0;
|
||||
|
||||
|
||||
/* public functions */
|
||||
|
@ -188,7 +190,6 @@ gui_init (Gimp *gimp,
|
|||
gboolean no_splash)
|
||||
{
|
||||
GimpInitStatusFunc status_callback = NULL;
|
||||
GdkScreen *screen;
|
||||
gchar *abort_message;
|
||||
|
||||
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
|
||||
|
@ -233,12 +234,12 @@ gui_init (Gimp *gimp,
|
|||
|
||||
themes_init (gimp);
|
||||
|
||||
screen = gdk_screen_get_default ();
|
||||
gtk_widget_set_default_colormap (gdk_screen_get_rgb_colormap (screen));
|
||||
initial_monitor = gimp_get_monitor_at_pointer (&initial_screen);
|
||||
gtk_widget_set_default_colormap (gdk_screen_get_rgb_colormap (initial_screen));
|
||||
|
||||
if (! no_splash)
|
||||
{
|
||||
splash_create (gimp->be_verbose);
|
||||
splash_create (gimp->be_verbose, initial_screen, initial_monitor);
|
||||
status_callback = splash_update;
|
||||
}
|
||||
|
||||
|
@ -570,20 +571,24 @@ gui_restore_after_callback (Gimp *gimp,
|
|||
if (gimp_get_show_gui (gimp))
|
||||
{
|
||||
GimpDisplayShell *shell;
|
||||
GtkWidget *toplevel;
|
||||
|
||||
/* create the empty display */
|
||||
display = GIMP_DISPLAY (gimp_create_display (gimp, NULL,
|
||||
GIMP_UNIT_PIXEL, 1.0,
|
||||
NULL, /* FIXME monitor */
|
||||
0 /* FIXME monitor */));
|
||||
G_OBJECT (initial_screen),
|
||||
initial_monitor));
|
||||
|
||||
shell = gimp_display_get_shell (display);
|
||||
|
||||
if (gui_config->restore_session)
|
||||
session_restore (gimp);
|
||||
session_restore (gimp,
|
||||
initial_screen,
|
||||
initial_monitor);
|
||||
|
||||
/* move keyboard focus to the display */
|
||||
gtk_window_present (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (shell))));
|
||||
toplevel = gtk_widget_get_toplevel (GTK_WIDGET (shell));
|
||||
gtk_window_present (GTK_WINDOW (toplevel));
|
||||
}
|
||||
|
||||
/* indicate that the application has finished loading */
|
||||
|
|
|
@ -316,14 +316,12 @@ session_exit (Gimp *gimp)
|
|||
}
|
||||
|
||||
void
|
||||
session_restore (Gimp *gimp)
|
||||
session_restore (Gimp *gimp,
|
||||
GdkScreen *screen,
|
||||
gint monitor)
|
||||
{
|
||||
GdkScreen *screen;
|
||||
gint monitor;
|
||||
|
||||
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
||||
|
||||
monitor = gimp_get_monitor_at_pointer (&screen);
|
||||
g_return_if_fail (GDK_IS_SCREEN (screen));
|
||||
|
||||
gimp_dialog_factory_restore (gimp_dialog_factory_get_singleton (),
|
||||
screen, monitor);
|
||||
|
|
|
@ -19,15 +19,17 @@
|
|||
#define __SESSION_H__
|
||||
|
||||
|
||||
void session_init (Gimp *gimp);
|
||||
void session_exit (Gimp *gimp);
|
||||
void session_init (Gimp *gimp);
|
||||
void session_exit (Gimp *gimp);
|
||||
|
||||
void session_restore (Gimp *gimp);
|
||||
void session_save (Gimp *gimp,
|
||||
gboolean always_save);
|
||||
void session_restore (Gimp *gimp,
|
||||
GdkScreen *screen,
|
||||
gint monitor);
|
||||
void session_save (Gimp *gimp,
|
||||
gboolean always_save);
|
||||
|
||||
gboolean session_clear (Gimp *gimp,
|
||||
GError **error);
|
||||
gboolean session_clear (Gimp *gimp,
|
||||
GError **error);
|
||||
|
||||
|
||||
#endif /* __SESSION_H__ */
|
||||
|
|
|
@ -93,14 +93,16 @@ static void splash_timer_elapsed (const gchar *text1,
|
|||
/* public functions */
|
||||
|
||||
void
|
||||
splash_create (gboolean be_verbose)
|
||||
splash_create (gboolean be_verbose,
|
||||
GdkScreen *screen,
|
||||
gint monitor)
|
||||
{
|
||||
GtkWidget *frame;
|
||||
GtkWidget *vbox;
|
||||
GdkPixbufAnimation *pixbuf;
|
||||
GdkScreen *screen;
|
||||
|
||||
g_return_if_fail (splash == NULL);
|
||||
g_return_if_fail (GDK_IS_SCREEN (screen));
|
||||
|
||||
pixbuf = splash_image_load (be_verbose);
|
||||
|
||||
|
@ -115,6 +117,7 @@ splash_create (gboolean be_verbose)
|
|||
"type-hint", GDK_WINDOW_TYPE_HINT_SPLASHSCREEN,
|
||||
"title", _("GIMP Startup"),
|
||||
"role", "gimp-startup",
|
||||
"screen", screen,
|
||||
"window-position", GTK_WIN_POS_CENTER,
|
||||
"resizable", FALSE,
|
||||
NULL);
|
||||
|
@ -123,8 +126,6 @@ splash_create (gboolean be_verbose)
|
|||
G_CALLBACK (exit),
|
||||
GINT_TO_POINTER (0));
|
||||
|
||||
screen = gtk_widget_get_screen (splash->window);
|
||||
|
||||
splash->width = MIN (gdk_pixbuf_animation_get_width (pixbuf),
|
||||
gdk_screen_get_width (screen));
|
||||
splash->height = MIN (gdk_pixbuf_animation_get_height (pixbuf),
|
||||
|
|
|
@ -19,7 +19,9 @@
|
|||
#define __SPLASH_H__
|
||||
|
||||
|
||||
void splash_create (gboolean be_verbose);
|
||||
void splash_create (gboolean be_verbose,
|
||||
GdkScreen *screen,
|
||||
gint monitor);
|
||||
void splash_destroy (void);
|
||||
|
||||
void splash_update (const gchar *label1,
|
||||
|
|
Loading…
Reference in New Issue