summaryrefslogtreecommitdiff
path: root/mate-window-picker-applet
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2019-10-30 10:34:54 +0100
committerZenWalker <[email protected]>2019-11-28 01:01:45 +0100
commit5b45af8351c19e42433207c0b47e20634ac705fd (patch)
tree94c54dda3a706343871656065baa95a39cdc679d /mate-window-picker-applet
parent3a9efe118d8d56d68ec8f71647228f374a627a89 (diff)
downloadmate-netbook-5b45af8351c19e42433207c0b47e20634ac705fd.tar.bz2
mate-netbook-5b45af8351c19e42433207c0b47e20634ac705fd.tar.xz
task-title: avoid 'g_type_class_add_private'
Diffstat (limited to 'mate-window-picker-applet')
-rw-r--r--mate-window-picker-applet/task-title.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/mate-window-picker-applet/task-title.c b/mate-window-picker-applet/task-title.c
index d30ba9c..925d1b9 100644
--- a/mate-window-picker-applet/task-title.c
+++ b/mate-window-picker-applet/task-title.c
@@ -25,12 +25,6 @@
#include <math.h>
-G_DEFINE_TYPE (TaskTitle, task_title, GTK_TYPE_EVENT_BOX);
-
-#define TASK_TITLE_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj),\
- TASK_TYPE_TITLE, \
- TaskTitlePrivate))
-
#define LOGOUT "mate-session-save --logout-dialog"
struct _TaskTitlePrivate
@@ -58,6 +52,8 @@ enum
static void disconnect_window (TaskTitle *title);
+G_DEFINE_TYPE_WITH_PRIVATE (TaskTitle, task_title, GTK_TYPE_EVENT_BOX);
+
static gboolean
start_logout_dialog (TaskTitle *title)
{
@@ -374,7 +370,7 @@ on_button_release (GtkWidget *title, GdkEventButton *event)
WnckWindow *window;
g_return_val_if_fail (TASK_IS_TITLE (title), FALSE);
- priv = TASK_TITLE_GET_PRIVATE (title);
+ priv = TASK_TITLE (title)->priv;
window = wnck_screen_get_active_window (priv->screen);
@@ -508,7 +504,7 @@ task_title_finalize (GObject *object)
{
TaskTitlePrivate *priv;
- priv = TASK_TITLE_GET_PRIVATE (object);
+ priv = TASK_TITLE (object)->priv;
disconnect_window (TASK_TITLE (object));
g_object_unref (G_OBJECT (priv->quit_icon));
@@ -543,8 +539,6 @@ task_title_class_init (TaskTitleClass *klass)
G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
wid_class->draw = on_draw;
-
- g_type_class_add_private (obj_class, sizeof (TaskTitlePrivate));
}
static void
@@ -556,7 +550,7 @@ task_title_init (TaskTitle *title)
AtkObject *atk;
int width, height;
- priv = title->priv = TASK_TITLE_GET_PRIVATE (title);
+ priv = title->priv = task_title_get_instance_private (title);
priv->screen = wnck_screen_get_default ();
priv->window = NULL;