Skip to content

Commit d714792

Browse files
wmwwraveit65
authored andcommitted
Clock: Wayland support
1 parent aa4754c commit d714792

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

‎applets/clock/clock-location-tile.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
#include <glib/gi18n.h>
99
#include <gtk/gtk.h>
10-
#include <gdk/gdkx.h>
1110

1211
#include "clock.h"
1312
#include "clock-face.h"

‎applets/clock/clock.c‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,12 @@
4949

5050
#include <gtk/gtk.h>
5151
#include <gdk/gdkkeysyms.h>
52-
#include <gdk/gdkx.h>
5352
#include <gio/gio.h>
5453

54+
#ifdef HAVE_X11
55+
#include <gdk/gdkx.h>
56+
#endif
57+
5558
#include <libmateweather/mateweather-prefs.h>
5659
#include <libmateweather/location-entry.h>
5760
#include <libmateweather/timezone-menu.h>
@@ -848,6 +851,7 @@ create_calendar (ClockData *cd)
848851
static void
849852
position_calendar_popup (ClockData *cd)
850853
{
854+
#ifdef HAVE_X11
851855
GtkRequisition req;
852856
GtkAllocation allocation;
853857
GdkDisplay *display;
@@ -860,6 +864,9 @@ position_calendar_popup (ClockData *cd)
860864
int i, n;
861865
gboolean found_monitor = FALSE;
862866

867+
if (!GDK_IS_X11_DISPLAY (gdk_display_get_default ()))
868+
return;
869+
863870
/* Get root origin of the toggle button, and position above that. */
864871
gdk_window_get_origin (gtk_widget_get_window (cd->panel_button),
865872
&x, &y);
@@ -943,6 +950,7 @@ position_calendar_popup (ClockData *cd)
943950

944951
gtk_window_move (GTK_WINDOW (cd->calendar_popup), x, y);
945952
gtk_window_set_gravity (GTK_WINDOW (cd->calendar_popup), gravity);
953+
#endif
946954
}
947955

948956
static void

0 commit comments

Comments
 (0)