Commit Graph

1672 Commits

Author SHA1 Message Date
Yuri Chornoivan
01bd4cc4e1 Fix minor typos 2020-05-28 11:00:03 +03:00
Matthias Clasen
efbc661620 window: Drop an unused field
The type-hint property is gone, and nothing reads
or writes the type_hint field anymore.
2020-05-26 19:30:26 -04:00
Timm Bäder
48c9c86626 window: Remove private _get_shadow_width()
Unused now.
2020-05-24 15:59:05 +02:00
Alexander Mikhaylenko
2ce8c82846 window: Fix tiled style class names
This should fix the round corners on tiled windows.
2020-05-20 22:10:32 +05:00
Timm Bäder
22e7d11583 window: Use GtkNative's check_resize everywhere 2020-05-20 18:12:22 +02:00
Timm Bäder
9cc6ddf80d window: Create default titlebar directly in realize
Instead of having two functions that are only called from one place but
look like they can be called from anywhere.
2020-05-20 18:12:22 +02:00
Timm Bäder
ee9d99cba3 update documentation for new style classes and node names 2020-05-20 18:12:22 +02:00
Timm Bäder
dfbcd475f3 window: Fix the surface coordinates everywhere 2020-05-20 17:08:24 +02:00
Timm Bäder
018efdb8eb window: Inline gtk_window_configure() into only caller
And remove the prototype from gtkwindowprivate.h
2020-05-20 17:08:24 +02:00
Timm Bäder
ec594f80dc window: Rewrite edge region detection 2020-05-20 17:08:24 +02:00
Timm Bäder
131837087b window: Fix computing the opaque region
We need to look at the surface transform here as well now.
2020-05-20 17:08:21 +02:00
Timm Bäder
7eec162502 window: Avoid using GtkStyleContext in subtract_decoration_corners
We can do this by just using the GtkCssStyle these days.
2020-05-20 17:06:54 +02:00
Timm Bäder
8c884e94c2 window: Fix get_surface_transform()
Look at the shadow here.
2020-05-20 17:06:54 +02:00
Timm Bäder
7659d8af3d window: Set overflow to HIDDEN
It really doesn't make sense for the general window to allow drawing
outside of it.
2020-05-20 17:06:54 +02:00
Timm Bäder
b41838a7fd Window: Remove extra_input_region API
This is unused.
2020-05-20 17:06:54 +02:00
Timm Bäder
e1007e6c2b window: Remove decoration node 2020-05-20 17:06:54 +02:00
Timm Bäder
2c2092e7b8 window: Don't care about shadow in measure() 2020-05-20 17:06:54 +02:00
Timm Bäder
2579f66150 window: Don't care about shadow in size_allocate() 2020-05-20 17:06:54 +02:00
Timm Bäder
077692a8e1 window: Remove custom snapshot() implementation 2020-05-20 17:06:54 +02:00
Matthias Clasen
75d9310986 Change coordinate translation apis to take doubles
Change gtk_widget_translate_coordinates and
gtk_native_get_surface_transform to operate
on doubles. Update all callers.
2020-05-17 17:17:31 -04:00
Matthias Clasen
c0faf0c6b6 Merge branch 'toplevel-move-resize' into 'master'
Toplevel move resize

See merge request GNOME/gtk!1923
2020-05-17 19:15:46 +00:00
Benjamin Otte
b353221185 Merge branch 'wip/otte/monitors' into 'master'
various GDK cleanups

See merge request GNOME/gtk!1920
2020-05-17 16:57:52 +00:00
Matthias Clasen
f316fe0f58 window: Use toplevel begin_move/resize api
The GdkSurface api for this is going away.
2020-05-17 12:49:26 -04:00
Timm Bäder
9b98641ddd window: Use TRUE/FALSE for boolean values 2020-05-17 15:30:03 +02:00
Benjamin Otte
4c7914dc49 display: Remove unneeded getters
Applications can use the listmodel instead.
2020-05-17 07:32:37 +02:00
Matthias Clasen
8912a6eb75 gtk: Handle seatless displays
If you run weston with the headless backend, you get a Wayland
display with no seat, which is just fine by the protocol.

gdk_display_get_default_seat() returns NULL in this case. Various
widgets assume that we always have a seat with a keyboard and a
pointer, since that is what X guarantees. Make things survive
without that, so we can run the testsuite under a headless
Wayland compositor.
2020-05-15 14:11:53 -04:00
Timm Bäder
9149c79f25 window: Restructure gtk_window_destroy()
The previous code was unreffing the window twice, which caused problems
during dialog destruction. Move to g_list_store_find instead of
iterating manually.

ref() the window before and unref() after. g_list_store_remove will
actually unref() the window, since the toplevel_list owns its own
reference.

Fixes #2741
Fixes #2742
2020-05-13 12:18:09 +02:00
Timm Bäder
ddaf50dfcc window: Create constraint solver on demand 2020-05-13 11:52:16 +02:00
Matthias Clasen
ffcffcd773 window: Hide windows on destroy
I thought I could get away with just unrealizing the
window, but it turns out that gtk_window_hide() is the
place where we remove grabs when a modal dialog goes
away, so we ended up with stuck grabs.
2020-05-12 11:10:36 -04:00
Matthias Clasen
2a24b8c653 Replace most remaining uses of container api
These are all on GtkBox or enumerating children.
2020-05-11 22:38:21 -04:00
Matthias Clasen
501eda2956 window: Fix accessible implementation
Now that GtkWindow is no longer a container,
update the accessible implementation to match.
2020-05-11 15:42:52 -04:00
Matthias Clasen
cc28a7b0ef Merge branch 'wip/tintou/doc-fixes' into 'master'
docs: Fix several missing references in the documentation

See merge request GNOME/gtk!1874
2020-05-11 18:40:34 +00:00
Corentin Noël
076b2f11d2 docs: Fix several missing references in the documentation
This fixes several typos and missing references
2020-05-11 19:26:20 +02:00
Matthias Clasen
177c0eb9e2 Unset tooltip window earlier
This avoids a crash when the tooltip window tries
to update its action muxers.
2020-05-11 12:20:59 -04:00
Matthias Clasen
1306727fb1 window: Remove _set_has_user_ref_count 2020-05-11 12:20:59 -04:00
Matthias Clasen
6aebedb8bc window: Implement gtk_window_destroy
Don't call gtk_widget_destroy; instead implement
gtk_window_destroy outselves by removing the window
from the toplevel lista and dropping the reference that
GTK holds.
2020-05-11 12:20:59 -04:00
Matthias Clasen
025375ff5f Replace gtk_widget_destroy everywhere
Replace all remaining uses of gtk_widget_destroy
by gtk_container_remove or g_object_unref.
2020-05-11 12:20:59 -04:00
Matthias Clasen
cd0081d08a Use gtk_window_destroy
Replace calls to gtk_widget_destroy on windows
with gtk_window_destroy.
2020-05-11 12:20:57 -04:00
Matthias Clasen
48821a64d0 window: Add gtk_window_destroy
This is a replacement for gtk_widget_destroy for toplevels.
For now, it is just a wrapper.
2020-05-11 12:19:39 -04:00
Matthias Clasen
8f9c3ed44a Stop using gtk_widget_destroyed
Replace all internal use of gtk_widget_destroyed
by g_object_add_weak_pointer.
2020-05-11 12:19:37 -04:00
Matthias Clasen
b93631164f Remove lots of focus vfuncs
In many cases, the default widget vfuncs work just fine,
combined with setting focusable.
2020-05-11 00:11:37 -04:00
Matthias Clasen
eae4a194b8 Merge branch 'wip/exalm/headerbar-dragging' into 'master'
Extract GtkWindow dragging and titlebar actions

Closes #2689

See merge request GNOME/gtk!1814
2020-05-10 18:15:57 +00:00
Matthias Clasen
c4514e7eb4 window: Remove some dead code
We are not attaching windows anymore.
2020-05-09 19:27:56 -04:00
Alexander Mikhaylenko
f4538839d4 window: Stop handling dragging and titlebar actions
Since GtkWindowHandle and GtkHeaderBar do it now, it can be removed from
GtkWindow, along with GTK_WINDOW_REGION_TITLE which at this point doesn't
differ from GTK_WINDOW_REGION_CONTENT.

Closes https://gitlab.gnome.org/GNOME/gtk/-/issues/2689, since
GtkWindowHandle doesn't do that anymore.
2020-05-08 00:02:08 +05:00
Alexander Mikhaylenko
6c636642df widget: Pass parent to gtk_widget_consumes_motion()
Right now it assumes that the parent is a GtkWindow. This will break when
window dragging is handled by another widget.
2020-05-07 09:44:15 +05:00
Matthias Clasen
1f0024a7f0 tooltip: Add private api to allocate the window
Add private gtk_tooltip_maybe_allocate() function
and use it from GtkWindow and GtkPopover.

This will let us stop using the ::size-allocate signal,
without having to redo all the tooltip management first.

That will happen later.
2020-05-06 14:27:45 -04:00
Matthias Clasen
91d261a0b3 window: Remove some outdated info from the docs
Remove references to ::size-allocate and ::configure-event
from the docs.
2020-05-06 14:27:45 -04:00
Matthias Clasen
b96509c030 Merge branch 'wip/baedert/for-master' into 'master'
Wip/baedert/for master

See merge request GNOME/gtk!1828
2020-05-06 03:55:55 +00:00
Matthias Clasen
77d15b1751 window: Use dispose instead of destroy
The destroy vfunc is going away.
2020-05-05 18:23:54 -04:00
Matthias Clasen
e33da18577 window: Lower the visible focus timeout
Five seconds felt too long for some people in
initial feedback, so lets lower the timeout to
3 seconds.
2020-05-05 10:45:47 -04:00