summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-07-24 22:57:00 -0400
committerMatthias Clasen <mclasen@redhat.com>2020-07-25 11:57:37 -0400
commit73f4f518b88fa9145fc9ef71629d375aa1e702f0 (patch)
tree75f0c43318d12ddd65e851958589ae361a8dc0af
parent6e9dbba130b37cbc538d1d3a14cdb64f6c904f43 (diff)
downloadgtk+-73f4f518b88fa9145fc9ef71629d375aa1e702f0.tar.gz
gdk: Improve struct packing in places
Plug some holes in our structs by rearranging a few fields. This is was done looking at pahole output.
-rw-r--r--gdk/gdkcontentdeserializer.c2
-rw-r--r--gdk/gdkcontentserializer.c2
-rw-r--r--gdk/gdkdeviceprivate.h2
-rw-r--r--gdk/gdksurfaceprivate.h8
-rw-r--r--gdk/x11/gdkkeys-x11.c2
5 files changed, 7 insertions, 9 deletions
diff --git a/gdk/gdkcontentdeserializer.c b/gdk/gdkcontentdeserializer.c
index b372dc4847..5ee2fd35b8 100644
--- a/gdk/gdkcontentdeserializer.c
+++ b/gdk/gdkcontentdeserializer.c
@@ -68,6 +68,7 @@ struct _GdkContentDeserializer
GValue value;
GInputStream *stream;
int priority;
+ gboolean returned;
GCancellable *cancellable;
gpointer user_data;
GAsyncReadyCallback callback;
@@ -77,7 +78,6 @@ struct _GdkContentDeserializer
GDestroyNotify task_notify;
GError *error;
- gboolean returned;
};
struct _GdkContentDeserializerClass
diff --git a/gdk/gdkcontentserializer.c b/gdk/gdkcontentserializer.c
index aa22980f71..ea42397f99 100644
--- a/gdk/gdkcontentserializer.c
+++ b/gdk/gdkcontentserializer.c
@@ -70,6 +70,7 @@ struct _GdkContentSerializer
GValue value;
GOutputStream *stream;
int priority;
+ gboolean returned;
GCancellable *cancellable;
gpointer user_data;
GAsyncReadyCallback callback;
@@ -79,7 +80,6 @@ struct _GdkContentSerializer
GDestroyNotify task_notify;
GError *error;
- gboolean returned;
};
struct _GdkContentSerializerClass
diff --git a/gdk/gdkdeviceprivate.h b/gdk/gdkdeviceprivate.h
index 07184a3abe..93c7b7a558 100644
--- a/gdk/gdkdeviceprivate.h
+++ b/gdk/gdkdeviceprivate.h
@@ -40,13 +40,13 @@ struct _GdkDevice
GdkInputSource source;
gboolean has_cursor;
GdkAxisFlags axis_flags;
+ GdkDeviceType type;
GdkDisplay *display;
/* The paired logical device for logical devices,
* or the associated logical device for physical ones
*/
GdkDevice *associated;
GList *physical_devices;
- GdkDeviceType type;
GArray *axes;
guint num_touches;
diff --git a/gdk/gdksurfaceprivate.h b/gdk/gdksurfaceprivate.h
index 5d750bfe2e..55febf1dce 100644
--- a/gdk/gdksurfaceprivate.h
+++ b/gdk/gdksurfaceprivate.h
@@ -48,8 +48,6 @@ struct _GdkSurface
int x;
int y;
- guint8 resize_count;
-
GdkGLContext *gl_paint_context;
cairo_region_t *update_area;
@@ -63,16 +61,17 @@ struct _GdkSurface
GdkSurfaceState old_state;
GdkSurfaceState state;
+ guint8 resize_count;
+
guint8 alpha;
guint8 fullscreen_mode;
guint modal_hint : 1;
-
guint destroyed : 2;
-
guint in_update : 1;
guint frame_clock_events_paused : 1;
guint autohide : 1;
+ guint shortcuts_inhibited : 1;
struct {
GdkGravity surface_anchor;
@@ -101,7 +100,6 @@ struct _GdkSurface
cairo_region_t *opaque_region;
- guint shortcuts_inhibited : 1;
GdkSeat *current_shortcuts_inhibited_seat;
};
diff --git a/gdk/x11/gdkkeys-x11.c b/gdk/x11/gdkkeys-x11.c
index 689c6b330e..6e27537b56 100644
--- a/gdk/x11/gdkkeys-x11.c
+++ b/gdk/x11/gdkkeys-x11.c
@@ -55,8 +55,8 @@ typedef struct _DirectionCacheEntry DirectionCacheEntry;
struct _DirectionCacheEntry
{
guint serial;
- Atom group_atom;
PangoDirection direction;
+ Atom group_atom;
};
struct _GdkX11Keymap