Commit Graph

58119 Commits

Author SHA1 Message Date
Matthias Clasen
18e396ef6c Add gdk_surface_get_parent back
The api is the same, the parent is different.
This now returns the parent of popup surfaces.
2019-05-28 20:25:15 +00:00
Alexander Larsson
ebb89bca0d surface: Remove gdk_surface_set/merge_child_input_shapes()
These are useless now that we don't have child surfaces
2019-05-28 20:25:15 +00:00
Alexander Larsson
1c7eb5ca33 surface: Remove old debug code 2019-05-28 20:25:15 +00:00
Matthias Clasen
49268c23fd popover: Use GdkSurface::autohide
The new api is made for this case.
2019-05-28 20:25:14 +00:00
Matthias Clasen
b15ba64ec9 surface: Add an autohide property
This api is meant to mimic xdg-popover.grab - we
show the surface, and dismiss it when we get events
on other surfaces. For foreign surfaces, the compositor
handles that for us; for our own, we check outselves
before delivering events to GTK.
2019-05-28 20:25:14 +00:00
Matthias Clasen
2dd15346a7 broadway: Track popups
This is more or less a 1:1 copy of the X11 code.
2019-05-28 20:25:14 +00:00
Matthias Clasen
6f1c32b3eb x11: Implement popup surfaces
Make them use o-r windows, and move
with their parent.

We do a sort-of ok job on stacking order
here - whenever the parent window gets a
ConfigureNotify, we just restack all popups
directly on top of their parent. This is good
enough to keep popups on top of their parent
while we drag it around, and it gets the popup
to disappear when raising another window on
top of the parent.
2019-05-28 20:25:14 +00:00
Matthias Clasen
99783c7fb7 wayland: Use popup parents
Make the Wayland move-to-rect implementation
use popup parents.
2019-05-28 20:25:14 +00:00
Matthias Clasen
1661615fef surface: Stop setting transient-for for popups
This was just a hack to reuse the existing
infrastructure. Now that we store parents separately,
stop doing it.
2019-05-28 20:25:14 +00:00
Matthias Clasen
1fa2a8217f surface: Make move-to-rect work for popups
Now that we store popup parents separately,
the client-side move-to-rect implementation
must use them.
2019-05-28 20:25:14 +00:00
Matthias Clasen
9af6d7f733 surface: Store popup parent
Store popup parents separately from transient-for
parents, since these are separate concepts with
different behaviors. And we need the parent in
the frontend, so we can use it in the fallback
move-to-rect implementation.
2019-05-28 20:25:14 +00:00
Matthias Clasen
33c6dff881 gdk: Introduce a popup surface type
This surface type is meant to have semantics
similar to xdg-popup, with a mandatory parent,
and relative placement using gdk_surface_move_to_rect.
2019-05-28 20:25:14 +00:00
Matthias Clasen
07b3a093bf x11: Remove useless checks
All surfaces are toplevels now, no need
to check for this all over the place.
2019-05-28 20:25:14 +00:00
Matthias Clasen
712a5d4f25 Get rid of GdkSurfaceImpl
We don't need the complicated wrapper system anymore,
since client-side windows are gone. This commit moves
all the vfuncs to GtkSurfaceClass, and changes the
backends to just derive their surface implementation
from GdkSurface.
2019-05-28 20:25:14 +00:00
Matthias Clasen
93b8f2563d gdk: Add a private header
This is in preparation for getting rid of GdkSurfaceImpl.
2019-05-28 20:25:14 +00:00
Matthias Clasen
d2951d3aac Rename surface constructors
We want to use a gdk_surface_new_popup for popups,
and align the constructor names with the surface
types, so rename

gdk_surface_new_popup -> gdk_surface_new_temp
gdk_surface_new_popup_full -> gdk_surface_new_popup

The temp surface type will disappear eventually.
2019-05-28 20:25:14 +00:00
Matthias Clasen
0571fc265b surface: Cosmetics 2019-05-28 20:25:14 +00:00
Matthias Clasen
8536557007 gdk: Drop pass-through surfaces
With client-side windows gone, this property
is no longer used at all, and has been replaced
by a similar concept on the widget level.
Drop it.
2019-05-28 20:25:14 +00:00
Matthias Clasen
47fb092393 gdk: Drop GdkWindowAttr
All the information in it is already contained
in the surface object we pass along, and none
of the backend implementations were using the
attributes at all.
2019-05-28 20:25:14 +00:00
Matthias Clasen
2855729cb4 gdk: Drop input-only surfaces
We are not creating such surfaces anymore, and
they were only ever meaningfully implemented
on X11. Drop the concept, and the api for determining
if a surface is input-only.
2019-05-28 20:25:14 +00:00
Matthias Clasen
1a23ebf105 gdk: Remove an unused field
Spring cleaning. We are not using this field
at all, since we have the input_only boolean.
2019-05-28 20:25:14 +00:00
Matthias Clasen
82c8a05855 Drop gdk_surface_new_temp
This is no longer used, and the only difference
to gdk_surface_new_popup is input-only, which is
an X11-only concept.
2019-05-28 20:25:14 +00:00
Matthias Clasen
346bd3f6b5 menu: Stop using gdk_surface_new_temp
We can just as well use gdk_surface_new_popup.
2019-05-28 20:25:14 +00:00
Matthias Clasen
7c1509feaa x11: Stop using gdk_surface_new_temp
We can just as well use gdk_surface_new_popup.
2019-05-28 20:25:14 +00:00
Matthias Clasen
448312594c broadway: Stop using gdk_surface_new_temp
This is in preparation for adding a proper
popup surface type.
2019-05-28 20:25:14 +00:00
Matthias Clasen
6029875ed3 wayland: Remove a useless switch
We are setting the title unconditionally, now
2019-05-28 20:25:14 +00:00
Matthias Clasen
8bb7fcd30c docs: Remove references to gdk_device_grab
It is no longer public api, refer to gdk_seat_grab instead.
2019-05-28 20:25:14 +00:00
Matthias Clasen
f692974e5a gdk: Remove remnants of client-side windows
Now that all surfaces are native, we don't need
to separately keep track of grab surfaces and
their native ancestor anymore.
2019-05-28 20:25:14 +00:00
Matthias Clasen
bab5836e89 Drop gtk_widget_register_surface
This is no longer used.
2019-05-28 20:25:14 +00:00
Matthias Clasen
fa25b06a28 popover: Stop using gtk_widget_register_surface
The GtkRoot implementations are expected to handle
the necessary surface setup themselves, going forward.
2019-05-28 20:25:14 +00:00
Matthias Clasen
81a673c908 window: Stop using gtk_widget_register_surface
The GtkRoot implementations are expected to handle
the necessary surface setup themselves, going forward.
2019-05-28 20:25:14 +00:00
Matthias Clasen
55c286661b menu: Stop using gtk_widget_register_surface
It does not seem to be necessary at all.
2019-05-28 20:25:14 +00:00
Matthias Clasen
73a6aaebfd surface: Make gdk_surface_get_device_position void
None of the callers were using the return value,
and without child surfaces, it is not very useful.
2019-05-28 20:25:14 +00:00
Matthias Clasen
48b522c487 x11: Drop a gratitious use of gdk_event_get_root_coords
We are in the backend, so we can do the translation ourselves.
2019-05-28 20:25:14 +00:00
Matthias Clasen
bb399b5d8f Remove gdk_surface_get_geometry as public api
We still need to keep the vfunc around, since the
fallback implementation of gdk_display_get_monitor_at_surface
uses it. So, a GDK backend must either have root coordinates
or always return a monitor from monitor_at_surface.
2019-05-28 20:25:14 +00:00
Matthias Clasen
cb23d40d36 Drop gdk_surface_get_root_origin
It was not used.
2019-05-28 20:25:14 +00:00
Matthias Clasen
8ee1620a2c Remove gdk_surface_get_root_coords as public api
We still need to keep the vfunc around, since the
fallback implementation for move_to_rect uses it.
So, a GDK backend must either have root coordinates
or implement move_to_rect.
2019-05-28 20:25:14 +00:00
Matthias Clasen
2ccd0dc8c6 Remove gdk_surface_coords_to/from_parent
This api was unused, and surfaces have no parents anymore.
2019-05-28 20:25:14 +00:00
Matthias Clasen
a3e0329a12 surface: Small simplification
No more special-casing of state setting.
2019-05-28 20:25:14 +00:00
Matthias Clasen
9b54f124e5 surface: Simplify destroy implementation
Without child surfaces, there is no need to recurse.
2019-05-28 20:25:14 +00:00
Matthias Clasen
3248bdc726 surface: Remove abs_x/abs_y
We no longer have child windows, so the offset is
always 0.
2019-05-28 20:25:14 +00:00
Matthias Clasen
0f5a6a3927 surface: Small cleanup
Every surface has an impl now, no need to check.
2019-05-28 20:25:14 +00:00
Matthias Clasen
77e99f70fe surface: Simplify some code
Fold gdk_surface_process_updates_recurse into its
only caller. There is no recursion here anymore.
2019-05-28 20:25:14 +00:00
Matthias Clasen
0699b17848 Remove surface->children
This field is not used at all anymore.
2019-05-28 20:25:13 +00:00
Matthias Clasen
2eebac8819 gdk: Stop using surface->children
It is always NULL.
2019-05-28 20:25:13 +00:00
Matthias Clasen
7aae92656d wayland: Stop using surface->children
It is always NULL.
2019-05-28 20:25:13 +00:00
Matthias Clasen
e68c5541e2 Remove surface->parent
This field is no longer used.
2019-05-28 20:25:13 +00:00
Matthias Clasen
0760958f71 gdk: Stop using surface->parent
It is always NULL.
2019-05-28 20:25:13 +00:00
Matthias Clasen
edab50139a broadway: Stop using surface->parent 2019-05-28 20:25:13 +00:00
Matthias Clasen
6183d58f80 x11: Stop using surface->parent
It is always NULL.
2019-05-28 20:25:13 +00:00