summaryrefslogtreecommitdiff
path: root/gdk/gdktoplevelprivate.h
diff options
context:
space:
mode:
authorJonas Ådahl <jadahl@gmail.com>2020-07-30 23:06:59 +0200
committerJonas Ådahl <jadahl@gmail.com>2020-08-05 15:49:00 +0200
commit2ff74eb667c2cbe293c7309d5661fa438e8431c4 (patch)
tree67d4f4087f45decc59014e07fb643e169cb2a10f /gdk/gdktoplevelprivate.h
parent4ee82e8175d1d1ed21d3ef8133f0d76267bde75c (diff)
downloadgtk+-2ff74eb667c2cbe293c7309d5661fa438e8431c4.tar.gz
gdk/toplevel: Negotiate surface size via a compute-size signal
GTK will not up front know how to correctly calculate a size, since it will not be able to reliably predict the constraints that may exist where it will be mapped. Thus, to handle this, calculate the size of the toplevel by having GDK emitting a signal called 'compute-size' that will contain information needed for computing a toplevel window size. This signal may be emitted at any time, e.g. during gdk_toplevel_present(), or spontaneously if constraints change. This also drops the max size from the toplevel layout, while moving the min size from the toplevel layout struct to the struct passed via the signal, This needs changes to a test case where we make sure we process GDK_CONFIGURE etc, which means we also needs to show the window and process all pending events in the test-focus-chain test case.
Diffstat (limited to 'gdk/gdktoplevelprivate.h')
-rw-r--r--gdk/gdktoplevelprivate.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/gdk/gdktoplevelprivate.h b/gdk/gdktoplevelprivate.h
index 6cdccca8b7..989ac29c46 100644
--- a/gdk/gdktoplevelprivate.h
+++ b/gdk/gdktoplevelprivate.h
@@ -2,6 +2,9 @@
#define __GDK_TOPLEVEL_PRIVATE_H__
#include "gdktoplevel.h"
+#include "gdktoplevelsizeprivate.h"
+
+#include <graphene.h>
G_BEGIN_DECLS
@@ -11,8 +14,6 @@ struct _GdkToplevelInterface
GTypeInterface g_iface;
gboolean (* present) (GdkToplevel *toplevel,
- int width,
- int height,
GdkToplevelLayout *layout);
gboolean (* minimize) (GdkToplevel *toplevel);
gboolean (* lower) (GdkToplevel *toplevel);
@@ -57,6 +58,9 @@ typedef enum
guint gdk_toplevel_install_properties (GObjectClass *object_class,
guint first_prop);
+void gdk_toplevel_notify_compute_size (GdkToplevel *toplevel,
+ GdkToplevelSize *size);
+
G_END_DECLS
#endif /* __GDK_TOPLEVEL_PRIVATE_H__ */