gtk2/gdk/gdktoplevelprivate.h
Jonas Ådahl 2ff74eb667 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.
2020-08-05 15:49:00 +02:00

67 lines
2.6 KiB
C

#ifndef __GDK_TOPLEVEL_PRIVATE_H__
#define __GDK_TOPLEVEL_PRIVATE_H__
#include "gdktoplevel.h"
#include "gdktoplevelsizeprivate.h"
#include <graphene.h>
G_BEGIN_DECLS
struct _GdkToplevelInterface
{
GTypeInterface g_iface;
gboolean (* present) (GdkToplevel *toplevel,
GdkToplevelLayout *layout);
gboolean (* minimize) (GdkToplevel *toplevel);
gboolean (* lower) (GdkToplevel *toplevel);
void (* focus) (GdkToplevel *toplevel,
guint32 timestamp);
gboolean (* show_window_menu) (GdkToplevel *toplevel,
GdkEvent *event);
gboolean (* supports_edge_constraints) (GdkToplevel *toplevel);
void (* inhibit_system_shortcuts) (GdkToplevel *toplevel,
GdkEvent *event);
void (* restore_system_shortcuts) (GdkToplevel *toplevel);
void (* begin_resize) (GdkToplevel *toplevel,
GdkSurfaceEdge edge,
GdkDevice *device,
int button,
double x,
double y,
guint32 timestamp);
void (* begin_move) (GdkToplevel *toplevel,
GdkDevice *device,
int button,
double x,
double y,
guint32 timestamp);
};
typedef enum
{
GDK_TOPLEVEL_PROP_STATE,
GDK_TOPLEVEL_PROP_TITLE,
GDK_TOPLEVEL_PROP_STARTUP_ID,
GDK_TOPLEVEL_PROP_TRANSIENT_FOR,
GDK_TOPLEVEL_PROP_MODAL,
GDK_TOPLEVEL_PROP_ICON_LIST,
GDK_TOPLEVEL_PROP_DECORATED,
GDK_TOPLEVEL_PROP_DELETABLE,
GDK_TOPLEVEL_PROP_FULLSCREEN_MODE,
GDK_TOPLEVEL_PROP_SHORTCUTS_INHIBITED,
GDK_TOPLEVEL_NUM_PROPERTIES
} GdkToplevelProperties;
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__ */