summaryrefslogtreecommitdiff
path: root/src/daemon/daemon.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/daemon/daemon.c')
-rw-r--r--src/daemon/daemon.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/daemon/daemon.c b/src/daemon/daemon.c
index a73ca93..62d7b04 100644
--- a/src/daemon/daemon.c
+++ b/src/daemon/daemon.c
@@ -53,6 +53,7 @@
#define MAX_NOTIFICATIONS 20
+#define WIDTH 400
#define IMAGE_SIZE 48
#define IDLE_SECONDS 30
#define NOTIFICATION_BUS_NAME "org.freedesktop.Notifications"
@@ -130,12 +131,32 @@ static void monitor_notification_source_windows(NotifyDaemon* daemon, NotifyTime
G_DEFINE_TYPE(NotifyDaemon, notify_daemon, G_TYPE_OBJECT);
+#if GTK_CHECK_VERSION (3, 0, 0)
+static void
+notify_daemon_get_preferred_width (GtkWidget *widget,
+ gint *min_width,
+ gint *nat_width)
+{
+ if (nat_width != NULL) {
+ *nat_width = WIDTH;
+ }
+}
+#endif
+
static void notify_daemon_class_init(NotifyDaemonClass* daemon_class)
{
GObjectClass* object_class = G_OBJECT_CLASS(daemon_class);
+#if GTK_CHECK_VERSION (3, 0, 0)
+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (daemon_class);
+#endif
+
object_class->finalize = notify_daemon_finalize;
+#if GTK_CHECK_VERSION (3, 0, 0)
+ widget_class->get_preferred_width = notify_daemon_get_preferred_width;
+#endif
+
g_type_class_add_private(daemon_class, sizeof(NotifyDaemonPrivate));
}