From ddd4bba22a4cd4ebd326694961190129d129d2fd Mon Sep 17 00:00:00 2001 From: Thomas White Date: Wed, 1 Jun 2011 13:53:56 +0200 Subject: Put slideshow on second monitor --- src/mainwindow.c | 6 +++++- src/presentation.h | 1 + src/slideshow.c | 17 +++++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mainwindow.c b/src/mainwindow.c index d0d668f..d407888 100644 --- a/src/mainwindow.c +++ b/src/mainwindow.c @@ -404,7 +404,11 @@ static gboolean expose_sig(GtkWidget *da, GdkEventExpose *event, /* Overall background */ cairo_rectangle(cr, event->area.x, event->area.y, event->area.width, event->area.height); - cairo_set_source_rgb(cr, 0.9, 0.9, 0.9); + if ( p->slideshow == NULL ) { + cairo_set_source_rgb(cr, 0.9, 0.9, 0.9); + } else { + cairo_set_source_rgb(cr, 1.0, 0.3, 0.2); + } cairo_fill(cr); /* Get the overall size */ diff --git a/src/presentation.h b/src/presentation.h index b6736b3..fe0abd2 100644 --- a/src/presentation.h +++ b/src/presentation.h @@ -61,6 +61,7 @@ struct presentation GtkWidget *ss_drawingarea; GdkCursor *blank_cursor; int ss_blank; + char ss_geom[256]; double slide_width; double slide_height; diff --git a/src/slideshow.c b/src/slideshow.c index a36aabe..1af0e18 100644 --- a/src/slideshow.c +++ b/src/slideshow.c @@ -152,6 +152,9 @@ static gboolean ss_realize_sig(GtkWidget *w, struct presentation *p) p->blank_cursor = gdk_cursor_new(GDK_BLANK_CURSOR); gdk_window_set_cursor(GDK_WINDOW(p->slideshow->window), p->blank_cursor); + + gtk_window_parse_geometry(GTK_WINDOW(w), p->ss_geom); + return FALSE; } @@ -159,6 +162,9 @@ static gboolean ss_realize_sig(GtkWidget *w, struct presentation *p) void try_start_slideshow(struct presentation *p) { GtkWidget *n; + GdkScreen *screen; + int n_monitors; + int i; /* Presentation already running? */ if ( p->slideshow != NULL ) return; @@ -183,6 +189,17 @@ void try_start_slideshow(struct presentation *p) gtk_widget_grab_focus(GTK_WIDGET(p->ss_drawingarea)); + screen = gdk_screen_get_default(); + n_monitors = gdk_screen_get_n_monitors(screen); + for ( i=0; iss_geom, 255, "%ix%i+%i+%i", + rect.width, rect.height, rect.x, rect.y); + } + p->slideshow = n; gtk_window_fullscreen(GTK_WINDOW(n)); gtk_widget_show_all(GTK_WIDGET(n)); -- cgit v1.2.3