Commit Graph

8888 Commits

Author SHA1 Message Date
Emmanuele Bassi
a5f22897f9 Relay the xdg_output.name to GdkMonitor
The xdg_output v2 interface has a `name` property that reflects the
output name coming from the compositor.

This is the closest thing we can get to a connector name.
2019-06-24 15:38:36 +01:00
Emmanuele Bassi
03840fb687 Add getter for a monitor connector
The migration from GdkScreen's monitor API to GdkMonitor left out a way
to get the connector's name of a monitor.

While there's no real guarantee coming from the underlying graphics
system that the connector's name is stable, some system components may
use it to uniquely identify a monitor until the next plug in/out event.
2019-06-24 15:38:36 +01:00
Benjamin Otte
c0bbfd950d x11: Actually call the finished func when finishing
Copy/paste madness was calling the status func...
2019-06-18 15:53:18 -04:00
Benjamin Otte
c2ac141031 contentformats: Fix doc typo 2019-06-18 15:50:53 -04:00
Matthias Clasen
bbea1cc841 wayland: Explicitly require RGBA8888
Its the format we expect to have. If we want to
support 10-bit visuals at some point, that should
be an explicit decision.
2019-06-17 12:41:01 -04:00
Christian Hergert
4d06ef5a39 profiler: add profiler marks for surface event delivery
This gives us marks to track the duration of processing certain types of
GdkEvent. It also provides some basic struct information in cases where
having that information would likely be useful for debugging.
2019-06-13 14:42:51 -07:00
Matthias Clasen
ed9b874d2e wayland: Fix the popover race workaround
The Wayland backend has a hack to work around
a race with popover mapping: If the surface size
changes before the initial configure, we hide and
show the surface. Unfortunately, the code was doing
this in a way that is externally observable (by
listening for surface state changes), and popovers
were observing it and hiding themselves in response.

Avoid this by not going through the GDK frontend
code for this.
2019-06-12 21:50:16 -04:00
Matthias Clasen
407ab93b59 gdk: Always deliver key events to toplevels
This is just a hack to see that this works.
Eventually, the backends should do the right
thing.
2019-06-09 17:38:54 +00:00
Matthias Clasen
c168116e64 Merge branch 'wip/matthiasc/shared-glyph-cache' into 'master'
Share the glyph cache

See merge request GNOME/gtk!912
2019-06-05 12:10:24 +00:00
Matthias Clasen
e08bab012c surface: Use surface->display directly
No need to go through a public getter
for internal uses.
2019-06-05 04:25:14 +00:00
Matthias Clasen
1f70bc4bf3 gdk: Create a global shared GL context
Create a global GL context that connects all
GL contexts on a display and lets us share textures
between them.
2019-06-04 23:00:02 +00:00
Руслан Ижбулатов
2ace3113d6 GDK W32: Ensure correct stacking of popup windows
1) In the SetWindowPos() function (and the WINDOWPOS struct) the
   "hWndInsertAfter" argument/field means the window that will be
   directly above after the change, not the window that will be
   directly below. MSDN says "precedes" for SetWindowPos(), but
   WINDOWPOS documentation is more precise: this is the window
   behind which the affected window will be placed. Apparently,
   Z-axis goes back-to-front.
   Therefore, logging should be reworded correctly.

2) When we switch away from the application and then switch back
   to a transient window, we need to bring up its transient-owner
   (and its transient-owner's owner and so forth) as well,
   otherwise our transient (modal) window might be transient for
   something that might not be visible.

3) When we bring up a window, we should bring all of its children
   (popup windows) on top of it.
   Because Windows doesn't provide a function to bring one window
   on top of the other, we have to work around this by calling
   SetWindowPos() twice, swapping the windows between the calls.
2019-06-01 19:23:30 +00:00
Matthias Clasen
57175dd5b1 Drop gdk_event_get_root_coords 2019-05-31 23:36:35 +00:00
Matthias Clasen
c7f06dd35e win32: Stop using gdk_event_get_root_coords
It seems we want local coords here anyway.
2019-05-31 23:36:35 +00:00
Matthias Clasen
2ae6f1a741 Add a gtk-overlay-scrolling setting
This is in preparation for letting user opt out of
overlay scrolling in the control-center.
2019-05-31 14:07:15 +00:00
Christian Hergert
bd26cce812 gtk: rely on default marshallers
Similar to previous removals of g_cclosure_marshal_VOID__VOID we can remove
other marshallers for which are a simple G_TYPE_NONE with single parameter.
In those cases, GLib will setup both a c_marshaller and va_marshaller for
us. Before this commit, we would not get a va_marshaller because the
c_marshaller is set.

Related to GNOME/Initiatives#10
2019-05-30 20:56:50 -07:00
Niels De Graef
df9aed6c61 Fix some GObject introspection annotations
Fixes several warnings by the GIR compiler.
2019-05-30 20:34:43 +02:00
Christian Hergert
3a0beeadc5 profiler: port GdkProfiler to sysprof-3
This uses the new sysprof-3 ABI to implement the capture writer. It also
uses the statically linked libsysprof-capture-3.a that is provided with
Sysprof for the capture writing to ensure that we do not leak any symbols
nor depend on any additional libraries.

The GTK_TRACE_FD can be used to pass a FD for tracing into Gtk. Sysprof
uses this when the Gtk instrument is selected for recording.
2019-05-29 19:02:30 -07:00
Christian Hergert
82afe850e8 marshallers: add missing g_cclosure_marshal_VOID__VOID fixes 2019-05-29 13:48:33 -07:00
Christian Hergert
f507a79056 marshallers: ensure g_cclosure_marshal_VOID__VOIDv is used
If we set c_marshaller manually, then g_signal_newv() will not setup a
va_marshaller for us. However, if we provide c_marshaller as NULL, it will
setup both the c_marshaller (to g_cclosure_marshal_VOID__VOID) and
va_marshaller (to g_cclosure_marshal_VOID__VOIDv) for us.
2019-05-29 13:22:31 -07:00
Matthias Clasen
792d578f4b Cosmetics
Remove a doc comment for no-longer-public api.
2019-05-29 18:04:15 +00:00
Matthias Clasen
9ecd906b7f Cosmetics
Drop a leftover declaration.
2019-05-29 18:04:13 +00:00
Matthias Clasen
51396533a1 Fix the win32 build
gdk_display_get_monitor_at_point was used
in this backend.
2019-05-29 18:04:13 +00:00
Matthias Clasen
8ed27d6e3b Drop gdk_surface_move
And its cousin, gdk_surface_move_resize.
These APIs are expecting global coordinates,
which are going away. GTK is not using them
anymore.
2019-05-29 18:04:08 +00:00
Matthias Clasen
12da0a6db1 Drop gdk_device_get_position
Root coordinates are going away, so this
api does not make sense anymore. Use
gdk_surface_get_device_position instead.
We still keep this as internal api for
root-coordinate using backends.
2019-05-29 18:04:08 +00:00
Matthias Clasen
d515c43dce Make gdk_surface_get_origin internal
We still use this function inside gdk in
a number of places, so keep it around.
2019-05-29 18:04:08 +00:00
Matthias Clasen
879f22fd27 Drop gdk_display_get_monitor_at_point
This api expects global coordinates, and
is unused.
2019-05-29 18:04:08 +00:00
Matthias Clasen
987e7878a2 Drop gdk_surface_get_frame_extents
No longer used.
2019-05-29 18:04:08 +00:00
Matthias Clasen
0103c13632 x11: Set surface position correctly
The X backend was storing global coordinates
in surface->x/y, and keeping the parent-relative
positions in its own fields. Switch this around
to store the relative position in x/y, as is
expected by the frontend.
2019-05-29 18:04:08 +00:00
Matthias Clasen
fd048005f5 Clarify gdk_surface_get_position
This function returns the position relative to
the surface parent, so will always return 0 for
non-popups. The out arguments don't need to
allow-none either - nobody passes NULL for these.
2019-05-29 18:04:08 +00:00
Matthias Clasen
902a49af9d surface: Add coordinate translation
We maintain offsets for popups, so we can translate
coordinates between surfaces that are attached directly
or indirectly to the same toplevel. Add an api for that.
2019-05-29 18:04:08 +00:00
Benjamin Otte
89fb752a8f css: Use %f, not %.17f
The testusite failures explain why:
We don't want to print "1.00000000000000000", but "1".
2019-05-29 14:30:13 +02:00
Benjamin Otte
d71c196c5c css: Don't print numbers with exponent
CSS does not do exponents, so printing numbers close to 0 as 1.234e-15
does not work.

Also up the accuracy to 17 digits because that's what everyone else
uses.
2019-05-29 07:14:31 +02:00
Руслан Ижбулатов
84739dde99 GDK W32: Fix indentation and placate GCC 2019-05-28 20:25:17 +00:00
Руслан Ижбулатов
d14e987c6c GDK W32: Correctly log popups 2019-05-28 20:25:17 +00:00
Руслан Ижбулатов
b12d521bce GDK W32: Only use owner windows for popups
GTK4 doesn't have WS_CHILD windows anymore, so hWndParent argument
to CreateWindowEx() is always interpreted as the owner window,
not the parent window.

A window with an owner:
* is above the owner in Z-order
* is destroyed when the owner is destroyed
* is hidden when the owner is minimized
This is enforced by the OS.

GTK can only allow this for popup windows.

Desktop window must never[0] be an owner.

[0]: https://devblogs.microsoft.com/oldnewthing/20040224-00/?p=40493
2019-05-28 20:25:17 +00:00
Руслан Ижбулатов
493b30c2a8 GDK W32: No more child windows
We don't have child windows (the window-inside-a-window kind of windows)
anymore. Remove all the code related to that.
2019-05-28 20:25:17 +00:00
Руслан Ижбулатов
5ff7c3431b GDK W32: Don't handle WM_ACTIVATE for popup windows
Popups can't be active or inactive, so emitting GDK events
in response to WM_ACTIVATE makes no sense for these kinds
of GDK surfaces.

The jury is still out on whether we should block (return 0)
or ignore (don't return anything) this message.

Blocking WM_NCACTIVATE (which we currently ignore) is definitely
not an option - it completely breaks input somehow.
2019-05-28 20:25:17 +00:00
Руслан Ижбулатов
6ab565b84a GDK W32: Adjust to new popup surfaces
1) Handle GDK_SURFACE_POPUP in RegisterGdkClass()
   (for now pretend it's the same as GDK_SURFACE_TOPLEVEL)

2) Remove useless code from GDK_SURFACE_TOPLEVEL case in _gdk_win32_display_create_surface()
   (now there's just GDK_SURFACE_TOPLEVEL there, no need for a type check)

3) Have a separate case for GDK_SURFACE_POPUP and ensure that
   it doesn't get WS_CHILDWINDOW (and neither should GDK_SURFACE_TEMP).
2019-05-28 20:25:17 +00:00
Matthias Clasen
11fdde0b8f surface: Cosmetics
Move things where they belong.
2019-05-28 20:25:17 +00:00
Matthias Clasen
2fa1a0a651 wayland: Disconnect the frame clock
The frame clock can survive the surface now,
so we need to disconnect.
2019-05-28 20:25:17 +00:00
Matthias Clasen
07b0da615b win32: Disconnect the frame clock
The frame clock can now survive the surface,
so we need to disconnect when the surface goes away.
2019-05-28 20:25:17 +00:00
Matthias Clasen
2aa0ceaeca x11: Disconnect from the frame clock
The frame clock can now survive its surface,
so we need to disconnect signal handlers.
2019-05-28 20:25:17 +00:00
Matthias Clasen
28addd3775 broadway: Disconnect from the frame clock
The frame clock can no survive its surface,
so we need to disconnect signal handlers.
2019-05-28 20:25:17 +00:00
Matthias Clasen
a3f127b0d0 surface: Give backends a chance to disconnect
Call the destroy vfunc before clearing
frame clock and gl context, so backends
have a chance to clean up.
2019-05-28 20:25:17 +00:00
Matthias Clasen
c7f9f8f63d surface: Fix the fallback move-to-rect implementation
On X11, the final and flipped rects were reporting
global coordinates. This was showing up as misplaced
popover beaks.
2019-05-28 20:25:17 +00:00
Matthias Clasen
78c94f9357 win32: Set surface type early enough
We need to set the surface type before
the frame clock.
2019-05-28 20:25:17 +00:00
Matthias Clasen
895962d781 surface: Make only toplevels control events
There is no need for popups to connect to the frame
clock to pause and unpause events on the display -
the toplevel already does it.

And don't connect to paint either - handle paint
on popups recursively.
2019-05-28 20:25:17 +00:00
Matthias Clasen
3d283cc8f4 gdk: Maintain popup tree in the frontend
We will need this information here, and we can
share the child lists between various backends.
2019-05-28 20:25:17 +00:00
Matthias Clasen
44be64278b surface: Make surface-type a property
Make surface-type a construct-only property,
so we can set it before the frame clock.
2019-05-28 20:25:16 +00:00
Matthias Clasen
2c43f87ef7 win32: Set the surface type
This is copying some code from the corresponding
create_surface implementations of the other backends.
2019-05-28 20:25:16 +00:00
Руслан Ижбулатов
138104de27 GDK W32: Fix the code to compile
Somewhat change the order of initialization (to be closer
to what Wayland backend does).

Also remove the wrapper field that is no longer needed -
it used to hold a pointer to the main GdkWindow instance,
which wrapped GdkWin32ImplWindow. Since impls are gone,
nothing is wrapping anything anymore.

Fix a substitution error, where wrong pointer was added
to the hash table. Added a comment to ensure that future readers
(including myself) won't be confused by the fact that we're
inserting a pointer instead of the handle itself.
2019-05-28 20:25:16 +00:00
Руслан Ижбулатов
d5e26cdb76 GDK W32: be able to handle NULL cursor 2019-05-28 20:25:16 +00:00
Matthias Clasen
c2b9a12f6f surface: Don't dispose the frame clock prematurely
Since we are now sharing frame clocks with multiple
surfaces, we can no longer dispose them unconditionally
when a surface goes away. Only do it if we are a
toplevel (without parent).

This was showing up as criticals on exit when opening
and closing any popover in widget factory.
2019-05-28 20:25:16 +00:00
Matthias Clasen
f728295e8c Cosmetics 2019-05-28 20:25:16 +00:00
Matthias Clasen
09ec88d0ce win32: Build fixes 2019-05-28 20:25:15 +00:00
Matthias Clasen
db855e092d Add a GdkSurface::parent property 2019-05-28 20:25:15 +00:00
Matthias Clasen
fa9cbf6c7d x11: Fix handling of frame clock freezes
Now that popups share the frame clock of their
parent, we have to be much more careful about
freezing the clock, since that may stop updates
for another surface.

This commit makes two changes that make the
X11 handling of the frame clock more similar
to the Wayland backend:
- Use gdk_surface_freeze_updates instead of
  gdk_surface_freeze_toplevel_updates to avoid
  affecting the frame clock
- Bail out early in before_paint/after_paint
  if the surface is frozen, to avoid affecting
  the frame clock

Together, these two make the X11 popup surface
type work without freezing updates for the toplevel.
2019-05-28 20:25:15 +00:00
Matthias Clasen
ef353f24c6 gdk: Inherit the frame clock for popups
With separate clocks, the phases are not coordinated,
which messes with GTKs size allocation machinery treating
the entire widget tree as a whole, and causes us to
run into assertion where popups get drawn before they
are allocated.
2019-05-28 20:25:15 +00:00
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
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
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
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
Matthias Clasen
bb1dd3f3ae wayland: Stop using surface->parent
It is always NULL.
2019-05-28 20:25:13 +00:00
Matthias Clasen
60ec1ee334 surface: Remove code dealing with child surfaces
We no longer have child surfaces, so this code
is never run.
2019-05-28 20:25:13 +00:00
Matthias Clasen
90e86b351d surface: minor cleanup
Make gdk_surface_new fully private, and reduce the use
of GdkSurfaceAttr.
2019-05-28 20:25:13 +00:00
Matthias Clasen
989792cbc0 Drop child surfaces
Drop gdk_surface_child_new and the child surface type,
since we no longer use them. Deprecate surface apis
that only make sense with child surfaces.
2019-05-28 20:25:13 +00:00
Matthias Clasen
f7e1146eda wayland: Stop using child surface apis
We no longer have child surfaces.
Drop code that only makes sense in their
presence.
2019-05-28 20:25:13 +00:00
Matthias Clasen
68e5456db9 x11: Stop using child surface api
We no longer have child surfaces.
Drop code that only makes sense in
that case.
2019-05-28 20:25:13 +00:00
Matthias Clasen
9e6d8becbb surface: Start sketching a new surface type
Start by adding a constructor. We have to call it
gdk_surface_new_popup_full for now, since gdk_surface_new_popup
is taken. This may be reshuffled later.
2019-05-28 20:25:13 +00:00
Benjamin Otte
096d28e60c surface: Add marshallers for new events
This way, sysprof can profile through the signal emission, and for
signals this low in the stack, this is very useful.
2019-05-28 19:19:24 +02:00
Matthias Clasen
106dd75b3b Remove an unused function
_gdk_make_event was not used anywhere.
2019-05-27 20:23:50 -04:00
Matthias Clasen
71cc68b14b surface: fix up docs
The docs for gdk_surface_invalidate_region were
talking about a no-longer-existing argument.
2019-05-26 00:07:47 -04:00
Matthias Clasen
c50052e223 Revert "wayland: Keep some resources until destroy"
This reverts commit f2d598b9a1.
2019-05-25 18:08:43 +00:00
Matthias Clasen
beedec1904 broadway: add frame times to the profiler 2019-05-24 07:19:14 -04:00
Olivier Fourdan
713fceb1bd wayland: Use scale from core wl_output protocol
The “xdg-output” protocol provides clients with the outputs size and
position in compositor coordinates, and does not provide the output
scale which is already provided by the core “wl_output” protocol.

So when receiving the wl_output scale event, we should update the scale
regardless of “xdg-output” support, otherwise the scale will remain to
its default value of 1 and the surface will be scaled up by the
compositor to match the actual output scale, which causes blurry fonts
and widgets.

Fixes: https://gitlab.gnome.org/GNOME/gtk/issues/1901
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2019-05-22 12:22:36 +02:00
Federico Mena Quintero
2a9b3c6a0c Use g_once for all the mkenums template files
Without this, initialization of enum/flags values from multithreaded
programs may not work correctly.

Fixes #1617.
2019-05-21 10:32:08 -05:00
Benjamin Otte
143bba075f win32: Remove outdated workaround
The function that was missing in 2016 does exist now.

Fixes gcc complaining about a wrong declaration.
2019-05-21 07:33:57 +02:00
Benjamin Otte
0877b29e8e win32: Actually pass y variable for y parameter 2019-05-21 07:23:30 +02:00
Benjamin Otte
1793546d7a win32: Remove unused variables 2019-05-21 07:23:30 +02:00
Benjamin Otte
678aa8088f rgba: Add GDK_RGBA() macro
So far it's private, but it's a pretty cute way to use hex colors, so we
might conside making it public.
2019-05-21 06:43:59 +02:00
Matthias Clasen
0a217cdd39 x11: Remove to unused settings
We no longer have settings for gtk-button-images
or gtk-menu-images.
2019-05-19 17:12:37 -04:00
Matthias Clasen
54530334f4 Revert "wayland: Make popups work more than once"
This reverts commit e74c655016.
2019-05-19 16:50:49 +00:00
Matthias Clasen
eed37cd59a Cosmetic changes
Use new-style padding for GdkContentProviderClass.
2019-05-19 16:20:15 +00:00
Matthias Clasen
d4f6bfbdad Merge branch 'frame-pixel-counter' into 'master'
profiling: Add a counter for pixels drawn per frame

See merge request GNOME/gtk!855
2019-05-19 15:20:52 +00:00
Matthias Clasen
e74c655016 wayland: Make popups work more than once
The change to keep some server resources around
until destroy was causing us to not recreate
the right things when a surface is hidden and
then shown again. Make sure to recreate everything.
2019-05-19 04:43:16 +00:00
Matthias Clasen
f2d598b9a1 wayland: Keep some resources until destroy
The Wayland backend was dropping _all_ serverside
resources on hide, which is too early e.g. for
GtkGLArea which wants to use egl resources to
unload textures on unrealize.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1485
2019-05-18 19:15:47 +00:00
Matthias Clasen
6c9d50a013 profiling: Add a counter for pixels drawn per frame
This number clearly shows the recently discovered
"full redraws" problem.
2019-05-18 18:04:35 +00:00
Benjamin Otte
6e2df85ec8 Merge branch 'wip/otte/for-master' into 'master'
Wip/otte/for master

Closes #1900

See merge request GNOME/gtk!854
2019-05-18 15:19:29 +00:00
Benjamin Otte
b76eb96c58 glcontext: Store the updated area in the right place
We need to store the region *before* adding our own damage area, because
we want to only store the changes of this frame, not the whole history.

So do it in the same place Vulkan does it.

Fixes #1900
2019-05-18 17:06:08 +02:00
Matthias Clasen
7e59ec4afc Add clock freezes to the profile 2019-05-16 20:50:31 +00:00
Matthias Clasen
15fec034df always record a frame end time when profiling
We need to keep this time, or we may end up with
negative frame intervals.
2019-05-16 19:45:30 +00:00
Matthias Clasen
33ffd54d5f Redo frame profiling
We were adding incomplete frame timings to the
profile, which lead to occasional nonsense
numbers. Instead, only add timings to the profile
once we marked them as complete. This also
gives us an opportunity to add the presentation
time as a marker.
2019-05-16 19:08:34 +00:00
Matthias Clasen
45b552d146 profiler: Prefer CLOCK_MONOTONIC
This is what g_get_monotonic_time gives us,
after all, and we need to have the same clock
in all our profiler data.
2019-05-15 13:52:12 -04:00
Carlos Garnacho
58cfafdf04 gdk/x11: Remove XI1 remnant
This header is not referenced anywhere.
2019-05-15 01:10:08 +02:00
Carlos Garnacho
c2d92794e2 gdk/x11: Drop GdkDeviceManagerCore
Keep only the XInput2 device manager, which handles "modern" stuff
like scroll and touch.
2019-05-15 01:05:29 +02:00
Carlos Garnacho
33642e2255 gdk/x11: Make XInput2 a mandatory runtime dependency for x11
Besides requiring it at build time, require that the server the client
is running against exposes the XInput2 protocol. We no longer fallback
on a device manager for core events.
2019-05-15 01:05:20 +02:00
Carlos Garnacho
c4446d36de gdk/x11: Drop GDK_CORE_DEVICE_EVENTS environment variable
Support for core events will be discontinued, so this doesn't make sense
anymore.
2019-05-15 01:05:20 +02:00
Carlos Garnacho
c4cf72ecb8 gdk/x11: Remove gdk_disable_multidevice()
Core events will be discontinued, so this call is meaningless now.
2019-05-15 01:05:20 +02:00
Carlos Garnacho
f3250172a4 gdk/x11: Make XInput2 a mandatory build time dependency for x11
XInput2 is more than a decade old already, and the input improvements
there (and in every other backend really) make it untenable to have
support for X11 core input events dragging things behind.
2019-05-15 01:05:20 +02:00
Matthias Clasen
ebc6bd834b profiling: Only use frame timings when we have them
Christian Hergert reported a crash here,
when testing the profiling code.
2019-05-14 12:06:55 +00:00
Matthias Clasen
b3ff4154ec Drop the public profiler api
I meant to do this before merging the profiler
support. Somehow the commit got lost.
2019-05-08 17:00:26 +00:00
Matthias Clasen
879a0c118d Profiler: drop the public api 2019-05-08 16:57:34 +00:00
Chun-wei Fan
705bf48eed gdk/gdkprofiler.c: Don't include unistd.h unconditionally
unistd.h is not universally available, so only include it when it can be
found during the configure stage.
2019-05-07 17:58:14 -07:00
Sebastian Dröge
2bd6661cd3 GdkSurface - Don't call unimplemented NULL set_startup_id() vfunc on Win32
GdkSurface::set_startup_id() is NULL on Win32 and would cause a segfault
if called.

While the documentation of the main caller of set_startup_id(),
gtk_window_set_startup_id(), mentions that it's not implemented on
Windows it can still be automatically called via Glade and simply doing
nothing on Win32 is going to be less disruptive than a segfault.
2019-05-07 21:38:46 +03:00
Matthias Clasen
1660bac6bd frame clock: Add tracing
Emit tracing data for frames. For now, we emit the
entire frame, and the layout and paint phases. Also
emit frames-per-second.
2019-05-07 09:37:59 -07:00
Matthias Clasen
9e40642335 Add a way to start the profiler
If SYSPROF_TRACE_FD is set in the environment,
interpret it as an fd to write profiling data
to.

If GTK_TRACE is set, write profiling data
to a file with name gtk.$PID.syscap.
2019-05-07 09:37:59 -07:00
Matthias Clasen
032bb45ce3 gdk: Add a profiler
This is writing data in the capture format of sysprof,
using the SpCaptureWriter. For now, this is using a
vendored copy of libsysprof. Eventually, we want to
use the static library that sysprof provides.
2019-05-07 09:37:59 -07:00
Benjamin Otte
e29cf84ac4 broadway: Install headers
How are we going to check a display for its broadway-ness otherwise?
2019-05-06 20:15:49 +02:00
Benjamin Otte
7ae675b469 build: Install the backend headers in the backend directories
That's where they are in the sources and we include them from other
headers. So make sure the directories match.
2019-05-06 20:14:53 +02:00