summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.am1
-rw-r--r--common/Makefile.am20
-rw-r--r--common/xfwm-common.c (renamed from settings-dialogs/common.c)30
-rw-r--r--common/xfwm-common.h (renamed from settings-dialogs/common.h)7
-rw-r--r--configure.ac.in1
-rw-r--r--settings-dialogs/Makefile.am18
-rw-r--r--settings-dialogs/tweaks-settings.c3
-rw-r--r--settings-dialogs/workspace-settings.c27
-rw-r--r--settings-dialogs/xfwm4-settings.c3
-rw-r--r--src/Makefile.am5
10 files changed, 76 insertions, 39 deletions
diff --git a/Makefile.am b/Makefile.am
index 00e880d75..0da25ab46 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -17,6 +17,7 @@ SUBDIRS = \
helper-dialog \
icons \
po \
+ common \
settings-dialogs \
src \
themes
diff --git a/common/Makefile.am b/common/Makefile.am
new file mode 100644
index 000000000..5fd949bfe
--- /dev/null
+++ b/common/Makefile.am
@@ -0,0 +1,20 @@
+AM_CPPFLAGS = \
+ -I${top_srcdir}
+
+noinst_LTLIBRARIES = \
+ libxfwm-common.la
+
+libxfwm_common_la_SOURCES = \
+ xfwm-common.c \
+ xfwm-common.h
+
+libxfwm_common_la_CFLAGS = \
+ $(GTK_CFLAGS) \
+ $(PLATFORM_CFLAGS)
+
+libxfwm_common_la_LIBADD = \
+ $(GTK_LIBS)
+
+libxfwm_common_la_LDFLAGS = \
+ -no-undefined \
+ $(PLATFORM_LDFLAGS)
diff --git a/settings-dialogs/common.c b/common/xfwm-common.c
index 2868108a5..b6c9ae25f 100644
--- a/settings-dialogs/common.c
+++ b/common/xfwm-common.c
@@ -18,7 +18,10 @@
* MA 02110-1301, USA.
*/
-#include <gtk/gtk.h>
+#include <string.h>
+#include <gdk/gdkx.h>
+
+#include "xfwm-common.h"
@@ -44,3 +47,28 @@ xfwm_widget_reparent (GtkWidget *widget,
}
}
+
+
+void
+xfwm_get_screen_dimensions (gint *width, gint *height)
+{
+#if GTK_CHECK_VERSION(3, 22, 0)
+ GdkDisplay *display;
+ GdkMonitor *monitor;
+ GdkRectangle geometry;
+
+ display = gdk_display_get_default ();
+ monitor = gdk_display_get_primary_monitor (display);
+ gdk_monitor_get_geometry (monitor, &geometry);
+
+ if (width != NULL)
+ *width = geometry.width;
+ if (height != NULL)
+ *height = geometry.height;
+#else
+ if (width != NULL)
+ *width = gdk_screen_width ();
+ if (height != NULL)
+ *height = gdk_screen_height ();
+#endif
+}
diff --git a/settings-dialogs/common.h b/common/xfwm-common.h
index ea8e59faf..eb2ed4182 100644
--- a/settings-dialogs/common.h
+++ b/common/xfwm-common.h
@@ -23,7 +23,10 @@
#include <gtk/gtk.h>
-void xfwm_widget_reparent (GtkWidget *widget,
- GtkWidget *new_parent);
+void xfwm_widget_reparent (GtkWidget *widget,
+ GtkWidget *new_parent);
+
+void xfwm_get_screen_dimensions (gint *width,
+ gint *height);
#endif /* !__COMMON_H__ */
diff --git a/configure.ac.in b/configure.ac.in
index 8ab67d812..5774ee809 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -284,6 +284,7 @@ icons/22x22/Makefile
icons/48x48/Makefile
icons/scalable/Makefile
po/Makefile.in
+common/Makefile
settings-dialogs/Makefile
src/Makefile
themes/Makefile
diff --git a/settings-dialogs/Makefile.am b/settings-dialogs/Makefile.am
index 4226a5c0c..74cb97b29 100644
--- a/settings-dialogs/Makefile.am
+++ b/settings-dialogs/Makefile.am
@@ -7,9 +7,7 @@ xfwm4_workspace_settings_SOURCES = \
workspace-settings.c \
xfwm4-workspace-dialog_ui.h \
workspace-resource.c \
- workspace-resource.h \
- common.c \
- common.h
+ workspace-resource.h
xfwm4_workspace_settings_CFLAGS = \
$(GTK_CFLAGS) \
@@ -25,6 +23,7 @@ xfwm4_workspace_settings_CFLAGS = \
-DWNCK_I_KNOW_THIS_IS_UNSTABLE
xfwm4_workspace_settings_LDADD = \
+ $(top_builddir)/common/libxfwm-common.la \
$(GTK_LIBS) \
$(GLIB_LIBS) \
$(DBUS_GLIB_LIBS) \
@@ -38,9 +37,7 @@ xfwm4_settings_SOURCES = \
xfwm4-settings.h \
xfwm4-dialog_ui.h \
range-debouncer.c \
- range-debouncer.h \
- common.c \
- common.h
+ range-debouncer.h
xfwm4_settings_CFLAGS = \
$(GTK_CFLAGS) \
@@ -54,6 +51,7 @@ xfwm4_settings_CFLAGS = \
-DLOCALEDIR=\"$(localedir)\"
xfwm4_settings_LDADD = \
+ $(top_builddir)/common/libxfwm-common.la \
$(GTK_LIBS) \
$(GLIB_LIBS) \
$(DBUS_GLIB_LIBS) \
@@ -65,9 +63,7 @@ xfwm4_tweaks_settings_SOURCES = \
tweaks-settings.c \
xfwm4-tweaks-dialog_ui.h \
range-debouncer.c \
- range-debouncer.h \
- common.c \
- common.h
+ range-debouncer.h
xfwm4_tweaks_settings_CFLAGS = \
$(GTK_CFLAGS) \
@@ -80,6 +76,7 @@ xfwm4_tweaks_settings_CFLAGS = \
-DLOCALEDIR=\"$(localedir)\"
xfwm4_tweaks_settings_LDADD = \
+ $(top_builddir)/common/libxfwm-common.la \
$(GTK_LIBS) \
$(GLIB_LIBS) \
$(DBUS_GLIB_LIBS) \
@@ -87,7 +84,8 @@ xfwm4_tweaks_settings_LDADD = \
$(LIBXFCONF_LIBS)
AM_CPPFLAGS = \
- -I${top_srcdir}
+ -I${top_srcdir} \
+ $(PLATFORM_CPPFLAGS)
if MAINTAINER_MODE
diff --git a/settings-dialogs/tweaks-settings.c b/settings-dialogs/tweaks-settings.c
index 1ed110941..b6691afba 100644
--- a/settings-dialogs/tweaks-settings.c
+++ b/settings-dialogs/tweaks-settings.c
@@ -43,9 +43,10 @@
#include <libxfce4ui/libxfce4ui.h>
#include <xfconf/xfconf.h>
+#include <common/xfwm-common.h>
+
#include "xfwm4-tweaks-dialog_ui.h"
#include "range-debouncer.h"
-#include "common.h"
static Window opt_socket_id = 0;
static gboolean opt_version = FALSE;
diff --git a/settings-dialogs/workspace-settings.c b/settings-dialogs/workspace-settings.c
index 911032bb2..67600a57a 100644
--- a/settings-dialogs/workspace-settings.c
+++ b/settings-dialogs/workspace-settings.c
@@ -37,8 +37,9 @@
#include <libxfce4ui/libxfce4ui.h>
#include <xfconf/xfconf.h>
+#include <common/xfwm-common.h>
+
#include "xfwm4-workspace-dialog_ui.h"
-#include "common.h"
#define WORKSPACES_CHANNEL "xfwm4"
@@ -303,28 +304,6 @@ workspace_dialog_setup_names_treeview(GtkBuilder *builder,
static void
-workspace_dialog_get_screen_dimensions (gint *width, gint *height)
-{
-#if GTK_CHECK_VERSION(3, 22, 0)
- GdkDisplay *display;
- GdkMonitor *monitor;
- GdkRectangle geometry;
-
- display = gdk_display_get_default ();
- monitor = gdk_display_get_primary_monitor (display);
- gdk_monitor_get_geometry (monitor, &geometry);
-
- *width = geometry.width;
- *height = geometry.height;
-#else
- *width = gdk_screen_width ();
- *height = gdk_screen_height ();
-#endif
-}
-
-
-
-static void
workspace_dialog_configure_widgets (GtkBuilder *builder,
XfconfChannel *channel)
{
@@ -352,7 +331,7 @@ workspace_dialog_configure_widgets (GtkBuilder *builder,
}
/* Set max margins range */
- workspace_dialog_get_screen_dimensions (&wmax, &hmax);
+ xfwm_get_screen_dimensions (&wmax, &hmax);
wmax /= 4;
hmax /= 4;
diff --git a/settings-dialogs/xfwm4-settings.c b/settings-dialogs/xfwm4-settings.c
index f590f7bd9..547e44915 100644
--- a/settings-dialogs/xfwm4-settings.c
+++ b/settings-dialogs/xfwm4-settings.c
@@ -46,10 +46,11 @@
#include <libxfce4kbd-private/xfce-shortcuts-provider.h>
#include <libxfce4kbd-private/xfce-shortcuts-xfwm4.h>
+#include <common/xfwm-common.h>
+
#include "xfwm4-dialog_ui.h"
#include "xfwm4-settings.h"
#include "range-debouncer.h"
-#include "common.h"
diff --git a/src/Makefile.am b/src/Makefile.am
index 7b3b96fb6..018cb36ec 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -93,6 +93,7 @@ xfwm4_CFLAGS = \
-DG_LOG_DOMAIN=\"xfwm4\"
xfwm4_LDADD = \
+ $(top_builddir)/common/libxfwm-common.la \
$(GLIB_LIBS) \
$(GTK_LIBS) \
$(COMPOSITOR_LIBS) \
@@ -110,6 +111,10 @@ xfwm4_LDADD = \
$(XINERAMA_LIBS) \
$(MATH_LIBS)
+AM_CPPFLAGS = \
+ -I${top_srcdir} \
+ $(PLATFORM_CPPFLAGS)
+
EXTRA_DIST = \
default_icon.png \
default_icon.svg \