Skip to content

Commit

Permalink
Clock: Wayland support
Browse files Browse the repository at this point in the history
  • Loading branch information
wmww authored and raveit65 committed Jan 29, 2019
1 parent aa4754c commit d714792
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 0 additions & 1 deletion applets/clock/clock-location-tile.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

#include <glib/gi18n.h>
#include <gtk/gtk.h>
#include <gdk/gdkx.h>

#include "clock.h"
#include "clock-face.h"
Expand Down
10 changes: 9 additions & 1 deletion applets/clock/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,12 @@

#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
#include <gdk/gdkx.h>
#include <gio/gio.h>

#ifdef HAVE_X11
#include <gdk/gdkx.h>
#endif

#include <libmateweather/mateweather-prefs.h>
#include <libmateweather/location-entry.h>
#include <libmateweather/timezone-menu.h>
Expand Down Expand Up @@ -848,6 +851,7 @@ create_calendar (ClockData *cd)
static void
position_calendar_popup (ClockData *cd)
{
#ifdef HAVE_X11
GtkRequisition req;
GtkAllocation allocation;
GdkDisplay *display;
Expand All @@ -860,6 +864,9 @@ position_calendar_popup (ClockData *cd)
int i, n;
gboolean found_monitor = FALSE;

if (!GDK_IS_X11_DISPLAY (gdk_display_get_default ()))
return;

/* Get root origin of the toggle button, and position above that. */
gdk_window_get_origin (gtk_widget_get_window (cd->panel_button),
&x, &y);
Expand Down Expand Up @@ -943,6 +950,7 @@ position_calendar_popup (ClockData *cd)

gtk_window_move (GTK_WINDOW (cd->calendar_popup), x, y);
gtk_window_set_gravity (GTK_WINDOW (cd->calendar_popup), gravity);
#endif
}

static void
Expand Down

0 comments on commit d714792

Please sign in to comment.