summaryrefslogtreecommitdiff
path: root/trashapplet/src
diff options
context:
space:
mode:
Diffstat (limited to 'trashapplet/src')
-rw-r--r--trashapplet/src/Makefile.am4
-rw-r--r--trashapplet/src/trash-empty.c12
-rw-r--r--trashapplet/src/trashapplet.c23
-rw-r--r--trashapplet/src/xstuff.c33
4 files changed, 17 insertions, 55 deletions
diff --git a/trashapplet/src/Makefile.am b/trashapplet/src/Makefile.am
index 6e34f837..e24c9233 100644
--- a/trashapplet/src/Makefile.am
+++ b/trashapplet/src/Makefile.am
@@ -1,7 +1,8 @@
AM_CPPFLAGS = -I$(top_srcdir) \
$(MATE_APPLETS4_CFLAGS) \
+ $(MATEDESKTOP_CFLAGS) \
$(GIO_CFLAGS) \
- -DTRASH_MENU_UI_DIR=\""$(datadir)/mate-2.0/ui"\"
+ -DTRASH_MENU_UI_DIR=\""$(datadir)/mate/ui"\"
libexec_PROGRAMS = trashapplet
@@ -14,6 +15,7 @@ trashapplet_SOURCES = \
trashapplet_LDADD = \
$(MATE_APPLETS4_LIBS) \
+ $(MATEDESKTOP_LIBS) \
$(GIO_LIBS) \
-lX11
diff --git a/trashapplet/src/trash-empty.c b/trashapplet/src/trash-empty.c
index 18a1260a..6505e50c 100644
--- a/trashapplet/src/trash-empty.c
+++ b/trashapplet/src/trash-empty.c
@@ -125,11 +125,7 @@ trash_empty_update_dialog (gpointer user_data)
static gboolean
trash_empty_done (gpointer user_data)
{
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_widget_destroy (GTK_WIDGET (trash_empty_dialog));
-#else
- gtk_object_destroy (GTK_OBJECT (trash_empty_dialog));
-#endif
g_assert (trash_empty_dialog == NULL);
@@ -264,11 +260,7 @@ trash_empty_start (GtkWidget *parent)
g_critical ("failed to parse trash-empty dialog markup");
if (trash_empty_dialog)
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_widget_destroy (GTK_WIDGET (trash_empty_dialog));
-#else
- gtk_object_destroy (GTK_OBJECT (trash_empty_dialog));
-#endif
g_object_unref (builder);
return;
@@ -310,11 +302,7 @@ trash_empty_confirmation_response (GtkDialog *dialog,
if (response_id == GTK_RESPONSE_YES)
trash_empty_start (GTK_WIDGET (dialog));
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_widget_destroy (GTK_WIDGET (dialog));
-#else
- gtk_object_destroy (GTK_OBJECT (dialog));
-#endif
g_assert (trash_empty_confirm_dialog == NULL);
}
diff --git a/trashapplet/src/trashapplet.c b/trashapplet/src/trashapplet.c
index 53b657d6..be92ca9d 100644
--- a/trashapplet/src/trashapplet.c
+++ b/trashapplet/src/trashapplet.c
@@ -34,6 +34,7 @@
#include <gdk/gdkkeysyms-compat.h>
#endif
#include <gio/gio.h>
+#include <libmate-desktop/mate-aboutdialog.h>
#include <mate-panel-applet.h>
#include "trash-empty.h"
@@ -187,11 +188,7 @@ trash_applet_size_allocate (GtkWidget *widget,
}
static void
-#if GTK_CHECK_VERSION (3, 0, 0)
trash_applet_dispose (GObject *object)
-#else
-trash_applet_destroy (GtkObject *object)
-#endif
{
TrashApplet *applet = TRASH_APPLET (object);
@@ -211,11 +208,7 @@ trash_applet_destroy (GtkObject *object)
g_object_unref (applet->icon);
applet->icon = NULL;
-#if GTK_CHECK_VERSION (3, 0, 0)
G_OBJECT_CLASS (trash_applet_parent_class)->dispose (object);
-#else
- GTK_OBJECT_CLASS (trash_applet_parent_class)->destroy (object);
-#endif
}
static void
@@ -434,7 +427,7 @@ trash_applet_show_about (GtkAction *action,
NULL
};
- gtk_show_about_dialog (NULL,
+ mate_show_about_dialog (NULL,
"version", VERSION,
"copyright", "Copyright \xC2\xA9 2004 Michiel Sikkes,"
"\xC2\xA9 2008 Ryan Lortie",
@@ -529,11 +522,7 @@ confirm_delete_immediately (GtkWidget *parent_view,
response = gtk_dialog_run (GTK_DIALOG (dialog));
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_widget_destroy (GTK_WIDGET (dialog));
-#else
- gtk_object_destroy (GTK_OBJECT (dialog));
-#endif
return response == GTK_RESPONSE_YES;
}
@@ -608,18 +597,10 @@ trash_applet_drag_data_received (GtkWidget *widget,
static void
trash_applet_class_init (TrashAppletClass *class)
{
-#if GTK_CHECK_VERSION (3, 0, 0)
GObjectClass *gobject_class = G_OBJECT_CLASS (class);
-#else
- GtkObjectClass *gtkobject_class = GTK_OBJECT_CLASS (class);
-#endif
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
-#if GTK_CHECK_VERSION (3, 0, 0)
gobject_class->dispose = trash_applet_dispose;
-#else
- gtkobject_class->destroy = trash_applet_destroy;
-#endif
widget_class->size_allocate = trash_applet_size_allocate;
widget_class->button_release_event = trash_applet_button_release;
widget_class->key_press_event = trash_applet_key_press;
diff --git a/trashapplet/src/xstuff.c b/trashapplet/src/xstuff.c
index 75ae8eb3..62f7c6bc 100644
--- a/trashapplet/src/xstuff.c
+++ b/trashapplet/src/xstuff.c
@@ -24,11 +24,6 @@
#include "xstuff.h"
-#if GTK_CHECK_VERSION (3, 0, 0)
-#define GDK_WINDOW_XWINDOW(x) GDK_WINDOW_XID(x)
-#define gdk_x11_drawable_get_xid(x) GDK_WINDOW_XID(x)
-#endif
-
static Atom
panel_atom_get (const char *atom_name)
{
@@ -162,7 +157,7 @@ xstuff_is_compliant_wm (void)
int size;
xdisplay = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
- root_window = GDK_WINDOW_XWINDOW (
+ root_window = GDK_WINDOW_XID (
gdk_get_default_root_window ());
/* FIXME this is totally broken; should be using
@@ -197,11 +192,11 @@ xstuff_set_no_group (GdkWindow *win)
XWMHints wmhints = {0};
XDeleteProperty (GDK_WINDOW_XDISPLAY (win),
- GDK_WINDOW_XWINDOW (win),
+ GDK_WINDOW_XID (win),
panel_atom_get ("WM_CLIENT_LEADER"));
old_wmhints = XGetWMHints (GDK_WINDOW_XDISPLAY (win),
- GDK_WINDOW_XWINDOW (win));
+ GDK_WINDOW_XID (win));
/* General paranoia */
if (old_wmhints != NULL) {
memcpy (&wmhints, old_wmhints, sizeof (XWMHints));
@@ -217,7 +212,7 @@ xstuff_set_no_group (GdkWindow *win)
}
XSetWMHints (GDK_WINDOW_XDISPLAY (win),
- GDK_WINDOW_XWINDOW (win),
+ GDK_WINDOW_XID (win),
&wmhints);
}
@@ -250,7 +245,7 @@ xstuff_set_pos_size (GdkWindow *window, int x, int y, int w, int h)
gdk_error_trap_push ();
XSetWMNormalHints (GDK_WINDOW_XDISPLAY (window),
- GDK_WINDOW_XWINDOW (window),
+ GDK_WINDOW_XID (window),
&size_hints);
gdk_window_move_resize (window, x, y, w, h);
@@ -278,7 +273,7 @@ xstuff_set_wmspec_dock_hints (GdkWindow *window,
}
XChangeProperty (GDK_WINDOW_XDISPLAY (window),
- GDK_WINDOW_XWINDOW (window),
+ GDK_WINDOW_XID (window),
panel_atom_get ("_NET_WM_WINDOW_TYPE"),
XA_ATOM, 32, PropModeReplace,
(unsigned char *) atoms,
@@ -300,7 +295,7 @@ xstuff_set_wmspec_strut (GdkWindow *window,
vals [3] = bottom;
XChangeProperty (GDK_WINDOW_XDISPLAY (window),
- GDK_WINDOW_XWINDOW (window),
+ GDK_WINDOW_XID (window),
panel_atom_get ("_NET_WM_STRUT"),
XA_CARDINAL, 32, PropModeReplace,
(unsigned char *) vals, 4);
@@ -310,7 +305,7 @@ void
xstuff_delete_property (GdkWindow *window, const char *name)
{
Display *xdisplay = GDK_WINDOW_XDISPLAY (window);
- Window xwindow = GDK_WINDOW_XWINDOW (window);
+ Window xwindow = GDK_WINDOW_XID (window);
XDeleteProperty (xdisplay, xwindow,
panel_atom_get (name));
@@ -342,7 +337,7 @@ draw_zoom_animation (GdkScreen *gscreen,
int depth;
dpy = gdk_x11_display_get_xdisplay (gdk_screen_get_display (gscreen));
- root_win = gdk_x11_drawable_get_xid (gdk_screen_get_root_window (gscreen));
+ root_win = GDK_WINDOW_XID (gdk_screen_get_root_window (gscreen));
screen = gdk_screen_get_number (gscreen);
#if GTK_CHECK_VERSION (3, 0, 0)
depth = DefaultDepth(dpy,screen);
@@ -495,15 +490,11 @@ xstuff_get_current_workspace (GdkScreen *screen)
int result;
int retval;
- root_window = gdk_x11_drawable_get_xid (
+ root_window = GDK_WINDOW_XID (
gdk_screen_get_root_window (screen));
gdk_error_trap_push ();
-#if GTK_CHECK_VERSION (3, 0, 0)
result = XGetWindowProperty (GDK_SCREEN_XDISPLAY (screen),
-#else
- result = XGetWindowProperty (gdk_display,
-#endif
root_window,
panel_atom_get ("_NET_CURRENT_DESKTOP"),
0, G_MAXLONG,
@@ -545,11 +536,11 @@ xstuff_grab_key_on_all_screens (int keycode,
if (grab)
XGrabKey (gdk_x11_display_get_xdisplay (display),
keycode, modifiers,
- gdk_x11_drawable_get_xid (root),
+ GDK_WINDOW_XID (root),
True, GrabModeAsync, GrabModeAsync);
else
XUngrabKey (gdk_x11_display_get_xdisplay (display),
keycode, modifiers,
- gdk_x11_drawable_get_xid (root));
+ GDK_WINDOW_XID (root));
}
}