summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2022-12-06 00:02:19 +0100
committerCarlos Garnacho <carlosg@gnome.org>2022-12-09 16:28:33 +0000
commit66b1f439675855e3320b3a24a30bdc2de8c492d5 (patch)
tree77cd1fcc5ffb482e87a88321c6508e08124539d1
parentac09ce11fd8f0a5a5f74b7f28b54e33ad81f6cd5 (diff)
downloadmutter-66b1f439675855e3320b3a24a30bdc2de8c492d5.tar.gz
Revert "x11: Move Motif WM hints to a separate header"
Since we use XCB in the Mutter side, but Xlib in the frames client, we cannot share the same struct definition since both libraries will expect different type lengths (respectively, 32-bit ints vs. longs). Revert the changes that made both executables share the same struct, since not both of them can get it right (and retrieve correctly the struct with the contained flags) in reading the Motif WM hints. This reverts commit 2fb3c5a4f577aea9a4fc721807eb1ca4a49b8990. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2741>
-rw-r--r--src/frames/meson.build2
-rw-r--r--src/frames/meta-frame.c19
-rw-r--r--src/x11/motif-wm-hints.h56
-rw-r--r--src/x11/xprops.h40
4 files changed, 57 insertions, 60 deletions
diff --git a/src/frames/meson.build b/src/frames/meson.build
index b4c879050..05c27d508 100644
--- a/src/frames/meson.build
+++ b/src/frames/meson.build
@@ -19,7 +19,7 @@ x11_frames = executable('mutter-x11-frames',
c_args: [
'-DG_LOG_DOMAIN="mutter-x11-frames"',
],
- include_directories: mutter_includes,
+ include_directories: top_includepath,
install: true,
install_dir: get_option('libexecdir'),
)
diff --git a/src/frames/meta-frame.c b/src/frames/meta-frame.c
index 7b55e74e5..f17fe982c 100644
--- a/src/frames/meta-frame.c
+++ b/src/frames/meta-frame.c
@@ -27,14 +27,29 @@
#include <gdk/x11/gdkx.h>
#include <X11/Xatom.h>
-#include "x11/motif-wm-hints.h"
-
struct _MetaFrame
{
GtkWindow parent_instance;
GtkWidget *content;
};
+typedef struct
+{
+ unsigned long flags;
+ unsigned long functions;
+ unsigned long decorations;
+ long input_mode;
+ unsigned long status;
+} MotifWmHints;
+
+#define MWM_HINTS_FUNCTIONS (1L << 0)
+
+#define MWM_FUNC_ALL (1L << 0)
+#define MWM_FUNC_RESIZE (1L << 1)
+#define MWM_FUNC_MINIMIZE (1L << 3)
+#define MWM_FUNC_MAXIMIZE (1L << 4)
+#define MWM_FUNC_CLOSE (1L << 5)
+
G_DEFINE_TYPE (MetaFrame, meta_frame, GTK_TYPE_WINDOW)
static void
diff --git a/src/x11/motif-wm-hints.h b/src/x11/motif-wm-hints.h
deleted file mode 100644
index 231aa106a..000000000
--- a/src/x11/motif-wm-hints.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (C) 2001 Havoc Pennington
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
-/* Copied from Lesstif by way of GTK. Rudimentary docs can be
- * found in some Motif reference guides online.
- */
-
-typedef struct {
- uint32_t flags;
- uint32_t functions;
- uint32_t decorations;
- uint32_t input_mode;
- uint32_t status;
-} MotifWmHints, MwmHints;
-
-#define MWM_HINTS_FUNCTIONS (1L << 0)
-#define MWM_HINTS_DECORATIONS (1L << 1)
-#define MWM_HINTS_INPUT_MODE (1L << 2)
-#define MWM_HINTS_STATUS (1L << 3)
-
-#define MWM_FUNC_ALL (1L << 0)
-#define MWM_FUNC_RESIZE (1L << 1)
-#define MWM_FUNC_MOVE (1L << 2)
-#define MWM_FUNC_MINIMIZE (1L << 3)
-#define MWM_FUNC_MAXIMIZE (1L << 4)
-#define MWM_FUNC_CLOSE (1L << 5)
-
-#define MWM_DECOR_ALL (1L << 0)
-#define MWM_DECOR_BORDER (1L << 1)
-#define MWM_DECOR_RESIZEH (1L << 2)
-#define MWM_DECOR_TITLE (1L << 3)
-#define MWM_DECOR_MENU (1L << 4)
-#define MWM_DECOR_MINIMIZE (1L << 5)
-#define MWM_DECOR_MAXIMIZE (1L << 6)
-
-#define MWM_INPUT_MODELESS 0
-#define MWM_INPUT_PRIMARY_APPLICATION_MODAL 1
-#define MWM_INPUT_SYSTEM_MODAL 2
-#define MWM_INPUT_FULL_APPLICATION_MODAL 3
-#define MWM_INPUT_APPLICATION_MODAL MWM_INPUT_PRIMARY_APPLICATION_MODAL
-
-#define MWM_TEAROFF_WINDOW (1L<<0)
diff --git a/src/x11/xprops.h b/src/x11/xprops.h
index e21d97d19..f55d80baa 100644
--- a/src/x11/xprops.h
+++ b/src/x11/xprops.h
@@ -26,7 +26,45 @@
#include <X11/extensions/sync.h>
#include "meta/display.h"
-#include "motif-wm-hints.h"
+
+/* Copied from Lesstif by way of GTK. Rudimentary docs can be
+ * found in some Motif reference guides online.
+ */
+typedef struct {
+ uint32_t flags;
+ uint32_t functions;
+ uint32_t decorations;
+ uint32_t input_mode;
+ uint32_t status;
+} MotifWmHints, MwmHints;
+
+#define MWM_HINTS_FUNCTIONS (1L << 0)
+#define MWM_HINTS_DECORATIONS (1L << 1)
+#define MWM_HINTS_INPUT_MODE (1L << 2)
+#define MWM_HINTS_STATUS (1L << 3)
+
+#define MWM_FUNC_ALL (1L << 0)
+#define MWM_FUNC_RESIZE (1L << 1)
+#define MWM_FUNC_MOVE (1L << 2)
+#define MWM_FUNC_MINIMIZE (1L << 3)
+#define MWM_FUNC_MAXIMIZE (1L << 4)
+#define MWM_FUNC_CLOSE (1L << 5)
+
+#define MWM_DECOR_ALL (1L << 0)
+#define MWM_DECOR_BORDER (1L << 1)
+#define MWM_DECOR_RESIZEH (1L << 2)
+#define MWM_DECOR_TITLE (1L << 3)
+#define MWM_DECOR_MENU (1L << 4)
+#define MWM_DECOR_MINIMIZE (1L << 5)
+#define MWM_DECOR_MAXIMIZE (1L << 6)
+
+#define MWM_INPUT_MODELESS 0
+#define MWM_INPUT_PRIMARY_APPLICATION_MODAL 1
+#define MWM_INPUT_SYSTEM_MODAL 2
+#define MWM_INPUT_FULL_APPLICATION_MODAL 3
+#define MWM_INPUT_APPLICATION_MODAL MWM_INPUT_PRIMARY_APPLICATION_MODAL
+
+#define MWM_TEAROFF_WINDOW (1L<<0)
/* These all return the memory from Xlib, so require an XFree()
* when they return TRUE. They return TRUE on success.