summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cut-n-paste/totem-screensaver/totem-scrsaver.c40
-rw-r--r--src/eom-file-chooser.c8
-rw-r--r--src/eom-properties-dialog.c8
-rw-r--r--src/eom-thumb-view.c4
4 files changed, 38 insertions, 22 deletions
diff --git a/cut-n-paste/totem-screensaver/totem-scrsaver.c b/cut-n-paste/totem-screensaver/totem-scrsaver.c
index bf2bce9..70fa788 100644
--- a/cut-n-paste/totem-screensaver/totem-scrsaver.c
+++ b/cut-n-paste/totem-screensaver/totem-scrsaver.c
@@ -290,13 +290,13 @@ screensaver_enable_x11 (TotemScrsaver *scr)
}
#endif /* HAVE_XTEST */
- XLockDisplay (GDK_DISPLAY());
- XSetScreenSaver (GDK_DISPLAY(),
+ XLockDisplay (gdk_x11_get_default_xdisplay());
+ XSetScreenSaver (gdk_x11_get_default_xdisplay(),
scr->priv->timeout,
scr->priv->interval,
scr->priv->prefer_blanking,
scr->priv->allow_exposures);
- XUnlockDisplay (GDK_DISPLAY());
+ XUnlockDisplay (gdk_x11_get_default_xdisplay());
}
#ifdef HAVE_XTEST
@@ -305,12 +305,12 @@ fake_event (TotemScrsaver *scr)
{
if (scr->priv->disabled)
{
- XLockDisplay (GDK_DISPLAY());
- XTestFakeKeyEvent (GDK_DISPLAY(), *scr->priv->keycode,
+ XLockDisplay (gdk_x11_get_default_xdisplay());
+ XTestFakeKeyEvent (gdk_x11_get_default_xdisplay(), *scr->priv->keycode,
True, CurrentTime);
- XTestFakeKeyEvent (GDK_DISPLAY(), *scr->priv->keycode,
+ XTestFakeKeyEvent (gdk_x11_get_default_xdisplay(), *scr->priv->keycode,
False, CurrentTime);
- XUnlockDisplay (GDK_DISPLAY());
+ XUnlockDisplay (gdk_x11_get_default_xdisplay());
/* Swap the keycode */
if (scr->priv->keycode == &scr->priv->keycode1)
scr->priv->keycode = &scr->priv->keycode2;
@@ -329,12 +329,12 @@ screensaver_disable_x11 (TotemScrsaver *scr)
#ifdef HAVE_XTEST
if (scr->priv->have_xtest != FALSE)
{
- XLockDisplay (GDK_DISPLAY());
- XGetScreenSaver(GDK_DISPLAY(), &scr->priv->timeout,
+ XLockDisplay (gdk_x11_get_default_xdisplay());
+ XGetScreenSaver(gdk_x11_get_default_xdisplay(), &scr->priv->timeout,
&scr->priv->interval,
&scr->priv->prefer_blanking,
&scr->priv->allow_exposures);
- XUnlockDisplay (GDK_DISPLAY());
+ XUnlockDisplay (gdk_x11_get_default_xdisplay());
if (scr->priv->timeout != 0) {
g_timeout_add_seconds (scr->priv->timeout / 2,
@@ -348,14 +348,14 @@ screensaver_disable_x11 (TotemScrsaver *scr)
}
#endif /* HAVE_XTEST */
- XLockDisplay (GDK_DISPLAY());
- XGetScreenSaver(GDK_DISPLAY(), &scr->priv->timeout,
+ XLockDisplay (gdk_x11_get_default_xdisplay());
+ XGetScreenSaver(gdk_x11_get_default_xdisplay(), &scr->priv->timeout,
&scr->priv->interval,
&scr->priv->prefer_blanking,
&scr->priv->allow_exposures);
- XSetScreenSaver(GDK_DISPLAY(), 0, 0,
+ XSetScreenSaver(gdk_x11_get_default_xdisplay(), 0, 0,
DontPreferBlanking, DontAllowExposures);
- XUnlockDisplay (GDK_DISPLAY());
+ XUnlockDisplay (gdk_x11_get_default_xdisplay());
}
static void
@@ -364,24 +364,24 @@ screensaver_init_x11 (TotemScrsaver *scr)
#ifdef HAVE_XTEST
int a, b, c, d;
- XLockDisplay (GDK_DISPLAY());
- scr->priv->have_xtest = (XTestQueryExtension (GDK_DISPLAY(), &a, &b, &c, &d) == True);
+ XLockDisplay (gdk_x11_get_default_xdisplay());
+ scr->priv->have_xtest = (XTestQueryExtension (gdk_x11_get_default_xdisplay(), &a, &b, &c, &d) == True);
if (scr->priv->have_xtest != FALSE)
{
- scr->priv->keycode1 = XKeysymToKeycode (GDK_DISPLAY(), XK_Alt_L);
+ scr->priv->keycode1 = XKeysymToKeycode (gdk_x11_get_default_xdisplay(), XK_Alt_L);
if (scr->priv->keycode1 == 0) {
g_warning ("scr->priv->keycode1 not existant");
}
- scr->priv->keycode2 = XKeysymToKeycode (GDK_DISPLAY(), XK_Alt_R);
+ scr->priv->keycode2 = XKeysymToKeycode (gdk_x11_get_default_xdisplay(), XK_Alt_R);
if (scr->priv->keycode2 == 0) {
- scr->priv->keycode2 = XKeysymToKeycode (GDK_DISPLAY(), XK_Alt_L);
+ scr->priv->keycode2 = XKeysymToKeycode (gdk_x11_get_default_xdisplay(), XK_Alt_L);
if (scr->priv->keycode2 == 0) {
g_warning ("scr->priv->keycode2 not existant");
}
}
scr->priv->keycode = &scr->priv->keycode1;
}
- XUnlockDisplay (GDK_DISPLAY());
+ XUnlockDisplay (gdk_x11_get_default_xdisplay());
#endif /* HAVE_XTEST */
}
diff --git a/src/eom-file-chooser.c b/src/eom-file-chooser.c
index c73d268..b1ee955 100644
--- a/src/eom-file-chooser.c
+++ b/src/eom-file-chooser.c
@@ -271,10 +271,18 @@ set_preview_pixbuf (EomFileChooser *chooser, GdkPixbuf *pixbuf, goffset size)
bytes_str = gdk_pixbuf_get_option (pixbuf, "tEXt::Thumb::Size");
if (bytes_str != NULL) {
bytes = atoi (bytes_str);
+#if GLIB_CHECK_VERSION (2, 30, 0)
+ size_str = g_format_size (bytes);
+#else
size_str = g_format_size_for_display (bytes);
+#endif
}
else {
+#if GLIB_CHECK_VERSION (2, 30, 0)
+ size_str = g_format_size (size);
+#else
size_str = g_format_size_for_display (size);
+#endif
}
/* try to read image dimensions */
diff --git a/src/eom-properties-dialog.c b/src/eom-properties-dialog.c
index 2549897..6cc737e 100644
--- a/src/eom-properties-dialog.c
+++ b/src/eom-properties-dialog.c
@@ -161,7 +161,11 @@ pd_update_general_tab (EomPropertiesDialog *prop_dlg,
gtk_label_set_text (GTK_LABEL (prop_dlg->priv->type_label), type_str);
bytes = eom_image_get_bytes (image);
+#if GLIB_CHECK_VERSION (2, 30, 0)
+ bytes_str = g_format_size (bytes);
+#else
bytes_str = g_format_size_for_display (bytes);
+#endif
gtk_label_set_text (GTK_LABEL (prop_dlg->priv->bytes_label), bytes_str);
@@ -491,8 +495,8 @@ pd_close_button_clicked_cb (GtkButton *button,
static gboolean
eom_properties_dialog_page_switch (GtkNotebook *notebook,
- GtkNotebookPage *page,
- gint page_index,
+ gpointer page,
+ guint page_index,
EomPropertiesDialog *prop_dlg)
{
diff --git a/src/eom-thumb-view.c b/src/eom-thumb-view.c
index 3375332..9c1a30e 100644
--- a/src/eom-thumb-view.c
+++ b/src/eom-thumb-view.c
@@ -345,7 +345,11 @@ thumbview_get_tooltip_string (EomImage *image)
ExifData *exif_data;
#endif
+#if GLIB_CHECK_VERSION (2, 30, 0)
+ bytes = g_format_size (eom_image_get_bytes (image));
+#else
bytes = g_format_size_for_display (eom_image_get_bytes (image));
+#endif
eom_image_get_size (image, &width, &height);