Compare commits

...

25 Commits

Author SHA1 Message Date
Matthias Clasen
0935a50bf5 macos: Use shadow size from GdkToplevelSize 2020-08-12 08:20:09 -04:00
Matthias Clasen
19d60d7234 broadway: Use shadow size from GtkToplevelSize 2020-08-12 08:20:09 -04:00
Matthias Clasen
f2c148c42d win32: Use shadow size from GdkToplevelSize 2020-08-12 08:20:09 -04:00
Matthias Clasen
5af0e93de0 x11: Use shadow size from GdkToplevelSize 2020-08-12 08:13:03 -04:00
Matthias Clasen
e21a7d70f1 window: Set shadow size in ::compute-size
This is the new way of communicating shadow size.
2020-08-12 08:00:34 -04:00
Matthias Clasen
bc05b0bba5 wayland: Use shadow size from GdkToplevelSize 2020-08-12 08:00:11 -04:00
Matthias Clasen
ece755ff62 toplevelsize: Add shadow size
Setting the shadow together with the size makes
sense, since the shadow is needed to make sense
of the size.
2020-08-12 07:59:16 -04:00
Matthias Clasen
8c1a99214f Revert "gridview: Work around unexpected focus changes"
This reverts commit c13d70479b.
2020-08-08 17:26:39 -04:00
Matthias Clasen
8ce83d03af window: Allocate on map
We normally wait for the surface ::size-changed signal,
but then we only queue a resize, which is not sufficient
on map - we need to have an allocation by the time start
moving focus around in show. So, call check_resize()
right away.
2020-08-08 17:26:39 -04:00
Matthias Clasen
29c83ef0b9 window: Some more renaming
Rename gtk_window_compute_configure_request
to gtk_window_compute_size and hints_changed
to min_size_changed.
2020-08-08 15:22:03 -04:00
Matthias Clasen
7def3bf542 window: Get rid of GdkGeometry uses
Instead, store a min size in the Private struct.
2020-08-08 15:22:03 -04:00
Matthias Clasen
6d855c307b window: Some renaming
Rename gtk_window_move_resize to gtk_window_do_resize
(no moving involved anymore), rename configure_notify_received
to need_resize and replace gtk_window_guess_default_size
by gtk_window_compute_default_size.
2020-08-08 15:22:03 -04:00
Matthias Clasen
baf05d816a window: Fix some issues in ::compute-size
gtk_window_compute_default_size was unsetting
need_default_size, before we were checking that
flag in toplevel_compute_size.
2020-08-08 15:22:03 -04:00
Matthias Clasen
490bfce319 window: Drop some dead code
We always set a min size
2020-08-08 15:22:03 -04:00
Matthias Clasen
a27fef3a27 window: Stop using gdk_surface_constrain_size 2020-08-08 15:22:03 -04:00
Matthias Clasen
294d45f0c7 window: Drop an unused argument 2020-08-08 15:22:03 -04:00
Matthias Clasen
1d068da0c9 window: Move the last size into the Private struct 2020-08-08 15:22:03 -04:00
Matthias Clasen
109c48a082 window: Move resize size into the Private struct
Another step towards getting rid of GdkGeometry here.
2020-08-08 15:22:03 -04:00
Matthias Clasen
21e730003a window: Move default size into the Private struct
This is a step towards getting rid of GdkGeometry
use here.
2020-08-08 15:22:03 -04:00
Matthias Clasen
55b77278f2 window: Move icon info into the Private struct
No need to use object data for this.
2020-08-08 15:22:03 -04:00
Matthias Clasen
b62802b52f window: Stop handling positions
We don't do positions anymore, time to stop trying.
2020-08-08 15:22:03 -04:00
Matthias Clasen
2ba9c35195 window: Stop counting ConfigureRequests
Stop counting configure reuqests and stop freezing
the surface ourselves. The backend should do that
if it wants to.
2020-08-08 15:22:03 -04:00
Matthias Clasen
bbb8c04323 wayland: bypass events for ::size-changed
This is a step towards getting rid of configure
events altogether.
2020-08-08 15:22:03 -04:00
Matthias Clasen
89a15f6d03 wayland: Don't emit premature configure events
We should not emit configure events before we
are realized - size changes at this point are
not relevant.

This gets rid of a mysterious emission of
GdkSurface::size-changed (52, 52), that is happening
when GtkWindow sets the shadow_width before the window
is mapped.
2020-08-08 15:22:03 -04:00
Matthias Clasen
16a7197586 bookmarksmanager: Load bookmarks initially
This was broken in 1e6171a4a7.
2020-08-08 13:56:17 -04:00
11 changed files with 339 additions and 786 deletions

View File

@@ -1555,10 +1555,12 @@ gdk_broadway_toplevel_present (GdkToplevel *toplevel,
gdk_toplevel_size_init (&size, bounds_width, bounds_height);
gdk_toplevel_notify_compute_size (toplevel, &size);
g_warn_if_fail (size.width > 0);
g_warn_if_fail (size.height > 0);
width = size.width;
height = size.height;
surface->shadow_left = size.shadow_left;
surface->shadow_right = size.shadow_right;
surface->shadow_top = size.shadow_top;
surface->shadow_bottom = size.shadow_bottom;
if (gdk_toplevel_layout_get_resizable (layout))
{

View File

@@ -118,6 +118,31 @@ gdk_toplevel_size_set_min_size (GdkToplevelSize *size,
size->min_height = min_height;
}
/**
* gdk_toplevel_size_set_shadow_size:
* @size: a #GdkToplevelSize
* @left: The left extent
* @right: The right extent
* @top: The top extent
* @bottom: The bottom extent
*
* Determine the size of the shadow and border area that should be
* considered “outside” for the purposes of window placement and
* edge snapping.
*/
void
gdk_toplevel_size_set_shadow_size (GdkToplevelSize *size,
int left,
int right,
int top,
int bottom)
{
size->shadow_left = left;
size->shadow_right = right;
size->shadow_top = top;
size->shadow_bottom = bottom;
}
void
gdk_toplevel_size_validate (GdkToplevelSize *size)
{
@@ -132,4 +157,7 @@ gdk_toplevel_size_validate (GdkToplevelSize *size)
if (size->min_width > size->width ||
size->min_height > size->height)
g_warning ("GdkToplevelSize: min_size exceeds size");
if (size->width <= 0 || size->height <= 0)
g_warning ("GdkToplevelSize: size can't be zero");
}

View File

@@ -54,6 +54,12 @@ void gdk_toplevel_size_set_min_size (GdkToplevelSize *
int min_width,
int min_height);
GDK_AVAILABLE_IN_ALL
void gdk_toplevel_size_set_shadow_size (GdkToplevelSize *size,
int left,
int right,
int top,
int bottom);
G_END_DECLS
#endif /* __GDK_TOPLEVEL_SIZE_H__ */

View File

@@ -30,6 +30,11 @@ struct _GdkToplevelSize
int height;
int min_width;
int min_height;
int shadow_left;
int shadow_right;
int shadow_top;
int shadow_bottom;
};
void gdk_toplevel_size_init (GdkToplevelSize *size,

View File

@@ -128,10 +128,12 @@ _gdk_macos_toplevel_surface_present (GdkToplevel *toplevel,
gdk_toplevel_size_init (&size, bounds_width, bounds_height);
gdk_toplevel_notify_compute_size (toplevel, &size);
g_warn_if_fail (size.width > 0);
g_warn_if_fail (size.height > 0);
width = size.width;
height = size.height;
surface->shadow_left = size.shadow_left;
surface->shadow_right = size.shadow_right;
surface->shadow_top = size.shadow_top;
surface->shadow_bottom = size.shadow_bottom;
if (gdk_toplevel_layout_get_resizable (layout))
{

View File

@@ -901,24 +901,6 @@ gdk_wayland_surface_finalize (GObject *object)
G_OBJECT_CLASS (gdk_wayland_surface_parent_class)->finalize (object);
}
static void
gdk_wayland_surface_resize (GdkSurface *surface,
int width,
int height,
int scale)
{
GdkDisplay *display;
GdkEvent *event;
event = gdk_configure_event_new (surface, width, height);
gdk_wayland_surface_update_size (surface, width, height, scale);
_gdk_surface_update_size (surface);
display = gdk_surface_get_display (surface);
_gdk_wayland_display_deliver_event (display, event);
}
static gboolean
is_realized_shell_surface (GdkSurface *surface)
{
@@ -946,6 +928,21 @@ is_realized_popup (GdkSurface *surface)
impl->display_server.zxdg_popup_v6);
}
static void
gdk_wayland_surface_resize (GdkSurface *surface,
int width,
int height,
int scale)
{
GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface);
gdk_wayland_surface_update_size (surface, width, height, scale);
_gdk_surface_update_size (surface);
if (impl->mapped)
g_signal_emit_by_name (surface, "size-changed", width, height);
}
static void gdk_wayland_surface_show (GdkSurface *surface,
gboolean already_mapped);
static void gdk_wayland_surface_hide (GdkSurface *surface);
@@ -1303,8 +1300,11 @@ configure_surface_geometry (GdkSurface *surface)
gdk_toplevel_notify_compute_size (GDK_TOPLEVEL (surface), &size);
width = size.width;
height = size.height;
g_warn_if_fail (width > 0);
g_warn_if_fail (height > 0);
impl->margin_left = surface->shadow_left = size.shadow_left;
impl->margin_right = surface->shadow_right = size.shadow_right;
impl->margin_top = surface->shadow_top = size.shadow_top;
impl->margin_bottom = surface->shadow_bottom = size.shadow_bottom;
layout = impl->toplevel.layout;
if (gdk_toplevel_layout_get_resizable (layout))

View File

@@ -4969,10 +4969,11 @@ gdk_win32_toplevel_present (GdkToplevel *toplevel,
gdk_toplevel_size_init (&size, bounds_width, bounds_height);
gdk_toplevel_notify_compute_size (toplevel, &size);
g_warn_if_fail (size.width > 0);
g_warn_if_fail (size.height > 0);
width = size.width;
height = size.height;
gdk_win32_surface_set_shadow_width (surface,
size.shadow_left, size.shadow_right,
size.shadow_top, size.shadow_bottom);
if (gdk_toplevel_layout_get_resizable (layout))
{

View File

@@ -4863,10 +4863,11 @@ gdk_x11_toplevel_present (GdkToplevel *toplevel,
gdk_toplevel_size_init (&size, bounds_width, bounds_height);
gdk_toplevel_notify_compute_size (toplevel, &size);
g_warn_if_fail (size.width > 0);
g_warn_if_fail (size.height > 0);
width = size.width;
height = size.height;
gdk_x11_surface_set_shadow_width (surface,
size.shadow_left, size.shadow_right,
size.shadow_top, size.shadow_bottom);
if (gdk_toplevel_layout_get_resizable (layout))
{

View File

@@ -294,6 +294,9 @@ _gtk_bookmarks_manager_new (GtkBookmarksChangedFunc changed_func, gpointer chang
manager->bookmarks_monitor_changed_id = g_signal_connect (manager->bookmarks_monitor, "changed",
G_CALLBACK (bookmarks_file_changed), manager);
g_file_load_contents_async (bookmarks_file, NULL, read_bookmarks_finish, manager);
g_object_unref (bookmarks_file);
return manager;

View File

@@ -1167,7 +1167,6 @@ gtk_grid_view_init (GtkGridView *self)
self->min_columns = 1;
self->max_columns = DEFAULT_MAX_COLUMNS;
self->n_columns = 1;
gtk_list_base_set_anchor_max_widgets (GTK_LIST_BASE (self),
self->max_columns * GTK_GRID_VIEW_MAX_VISIBLE_ROWS,

File diff suppressed because it is too large Load Diff