gnome-screensaver r1484 - in trunk: . savers src
- From: mccann svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-screensaver r1484 - in trunk: . savers src
- Date: Thu, 21 Aug 2008 01:16:42 +0000 (UTC)
Author: mccann
Date: Thu Aug 21 01:16:41 2008
New Revision: 1484
URL: http://svn.gnome.org/viewvc/gnome-screensaver?rev=1484&view=rev
Log:
2008-08-20 William Jon McCann <jmccann redhat com>
* savers/gs-theme-window.c (gs_theme_window_real_realize):
* savers/gste-slideshow.c (scale_pixbuf):
* src/debug-screensaver.sh:
* src/gs-manager.c (gs_manager_create_window_for_monitor),
(on_screen_monitors_changed):
Make the saver exit if the window it is drawing on is too
small. This can occur if the monitor is cloned.
Modified:
trunk/ChangeLog
trunk/savers/gs-theme-window.c
trunk/savers/gste-slideshow.c
trunk/src/debug-screensaver.sh
trunk/src/gs-manager.c
Modified: trunk/savers/gs-theme-window.c
==============================================================================
--- trunk/savers/gs-theme-window.c (original)
+++ trunk/savers/gs-theme-window.c Thu Aug 21 01:16:41 2008
@@ -44,6 +44,8 @@
G_DEFINE_TYPE (GSThemeWindow, gs_theme_window, GTK_TYPE_WINDOW)
+#define MIN_SIZE 10
+
static void
gs_theme_window_class_init (GSThemeWindowClass *klass)
{
@@ -178,6 +180,12 @@
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
gdk_window_get_geometry (window, &x, &y, &width, &height, NULL);
+
+ if (width < MIN_SIZE || height < MIN_SIZE) {
+ g_critical ("This window is way too small to use");
+ exit (1);
+ }
+
gtk_widget_size_request (widget, &requisition);
allocation.x = x;
allocation.y = y;
Modified: trunk/savers/gste-slideshow.c
==============================================================================
--- trunk/savers/gste-slideshow.c (original)
+++ trunk/savers/gste-slideshow.c Thu Aug 21 01:16:41 2008
@@ -67,7 +67,7 @@
GSList *filename_list;
char *images_location;
- gboolean sort_images;
+ gboolean sort_images;
int window_width;
int window_height;
PangoColor *background_color;
@@ -252,7 +252,7 @@
show->priv->background_color->green / 65535.0,
show->priv->background_color->blue / 65535.0, show->priv->alpha2);
} else {
- cairo_set_source_rgba (cr, 0.0, 0.0, 0.0, show->priv->alpha2);
+ cairo_set_source_rgba (cr, 0.0, 0.0, 0.0, show->priv->alpha2);
}
cairo_fill (cr);
/* left (excluding what's covered by top and bottom) */
@@ -264,7 +264,7 @@
show->priv->background_color->green / 65535.0,
show->priv->background_color->blue / 65535.0, show->priv->alpha2);
} else {
- cairo_set_source_rgba (cr, 0.0, 0.0, 0.0, show->priv->alpha2);
+ cairo_set_source_rgba (cr, 0.0, 0.0, 0.0, show->priv->alpha2);
}
cairo_fill (cr);
/* bottom */
@@ -275,7 +275,7 @@
show->priv->background_color->green / 65535.0,
show->priv->background_color->blue / 65535.0, show->priv->alpha2);
} else {
- cairo_set_source_rgba (cr, 0.0, 0.0, 0.0, show->priv->alpha2);
+ cairo_set_source_rgba (cr, 0.0, 0.0, 0.0, show->priv->alpha2);
}
cairo_fill (cr);
/* right (excluding what's covered by top and bottom) */
@@ -288,7 +288,7 @@
show->priv->background_color->green / 65535.0,
show->priv->background_color->blue / 65535.0, show->priv->alpha2);
} else {
- cairo_set_source_rgba (cr, 0.0, 0.0, 0.0, show->priv->alpha2);
+ cairo_set_source_rgba (cr, 0.0, 0.0, 0.0, show->priv->alpha2);
}
cairo_fill (cr);
@@ -468,9 +468,11 @@
/* always scale down, allow to disable scaling up */
if (scale_factor < 1.0 || !no_stretch_hint) {
- int scale_x = (int) (pw * scale_factor);
- int scale_y = (int) (ph * scale_factor);
+ int scale_x;
+ int scale_y;
+ scale_x = (int) (pw * scale_factor);
+ scale_y = (int) (ph * scale_factor);
return gdk_pixbuf_scale_simple (pixbuf,
scale_x,
scale_y,
@@ -637,7 +639,7 @@
g_async_queue_push_unlocked (show->priv->results_q, op_result);
if (show->priv->results_pull_id == 0) {
- show->priv->results_pull_id = g_idle_add_full (G_PRIORITY_HIGH_IDLE,
+ show->priv->results_pull_id = g_idle_add_full (G_PRIORITY_HIGH_IDLE,
(GSourceFunc)results_pull_func,
show, NULL);
}
@@ -738,9 +740,9 @@
case PROP_SOLID_BACKGROUND:
gste_slideshow_set_background_color (self, g_value_get_string (value));
break;
- case PROP_NO_STRETCH_HINT:
- gste_slideshow_set_no_stretch_hint (self, g_value_get_boolean (value));
- break;
+ case PROP_NO_STRETCH_HINT:
+ gste_slideshow_set_no_stretch_hint (self, g_value_get_boolean (value));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -761,9 +763,9 @@
case PROP_IMAGES_LOCATION:
g_value_set_string (value, self->priv->images_location);
break;
- case PROP_SORT_IMAGES:
- g_value_set_boolean (value, self->priv->sort_images);
- break;
+ case PROP_SORT_IMAGES:
+ g_value_set_boolean (value, self->priv->sort_images);
+ break;
case PROP_SOLID_BACKGROUND:
{
char *color = NULL;
@@ -772,9 +774,9 @@
g_free (color);
break;
}
- case PROP_NO_STRETCH_HINT:
- g_value_set_boolean (value, self->priv->no_stretch_hint);
- break;
+ case PROP_NO_STRETCH_HINT:
+ g_value_set_boolean (value, self->priv->no_stretch_hint);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -981,10 +983,10 @@
g_free (show->priv->images_location);
show->priv->images_location = NULL;
- if (show->priv->background_color) {
- g_slice_free (PangoColor, show->priv->background_color);
- show->priv->background_color = NULL;
- }
+ if (show->priv->background_color) {
+ g_slice_free (PangoColor, show->priv->background_color);
+ show->priv->background_color = NULL;
+ }
if (show->priv->timer != NULL) {
g_timer_destroy (show->priv->timer);
Modified: trunk/src/debug-screensaver.sh
==============================================================================
--- trunk/src/debug-screensaver.sh (original)
+++ trunk/src/debug-screensaver.sh Thu Aug 21 01:16:41 2008
@@ -39,4 +39,4 @@
#gnome-screensaver --no-daemon --debug > /tmp/gs-debug-log.txt 2>&1
# or just run it with debugging on
-gnome-screensaver --no-daemon --debug
+/opt/gnome/bin/gnome-screensaver --no-daemon --debug
Modified: trunk/src/gs-manager.c
==============================================================================
--- trunk/src/gs-manager.c (original)
+++ trunk/src/gs-manager.c Thu Aug 21 01:16:41 2008
@@ -1428,9 +1428,13 @@
GdkScreen *screen,
int monitor)
{
- GSWindow *window;
+ GSWindow *window;
+ GdkRectangle rect;
+
+ gdk_screen_get_monitor_geometry (screen, monitor, &rect);
- gs_debug ("Creating window for monitor %d", monitor);
+ gs_debug ("Creating window for monitor %d [%d,%d] (%dx%d)",
+ monitor, rect.x, rect.y, rect.width, rect.height);
window = gs_window_new (screen, monitor, manager->priv->lock_active);
@@ -1477,7 +1481,8 @@
this_screen = gs_window_get_screen (GS_WINDOW (l->data));
this_monitor = gs_window_get_monitor (GS_WINDOW (l->data));
if (this_screen == screen && this_monitor >= n_monitors) {
- gs_window_destroy (l->data);
+ manager_maybe_stop_job_for_window (manager, GS_WINDOW (l->data));
+ gs_window_destroy (GS_WINDOW (l->data));
manager->priv->windows = g_slist_delete_link (manager->priv->windows, l);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]