Commit Graph

61172 Commits

Author SHA1 Message Date
Benjamin Otte
8a098b1343 tests: Guard variables with necessary macros 2020-02-22 07:44:52 +01:00
Benjamin Otte
9d915ff431 treeviewcolumn: Inline variable into return_if_fail() 2020-02-22 07:44:52 +01:00
Benjamin Otte
6f0a0ce7f1 testsuite: Don't use g_return_if_fail()
Use g_assert()
2020-02-22 07:44:52 +01:00
Benjamin Otte
18d7187e4b testsuite: Don't use return_if_fail()
Use assert() instead
2020-02-22 07:35:23 +01:00
Benjamin Otte
d9e3eaaec8 treeview: Guard code by right compiler macros 2020-02-22 07:33:41 +01:00
Benjamin Otte
0c4c88b449 scrolledwindow: Inline variable into return_if_fail() 2020-02-22 07:33:41 +01:00
Benjamin Otte
2cb0007b89 iconview: Inline variables into return_if_fail() 2020-02-22 07:33:41 +01:00
Benjamin Otte
eb70173646 levelbar: Guard function by right compiler macros 2020-02-22 07:33:41 +01:00
Benjamin Otte
2e941acb29 filesystemmodel: Guard variable with correct compiler flags 2020-02-22 07:33:41 +01:00
Benjamin Otte
42d71f1016 combobox: Inline variables into return_if_fail() 2020-02-22 07:33:41 +01:00
Benjamin Otte
99fc31865a comboboxtext: Inline functions into return_if_fail() 2020-02-22 07:33:40 +01:00
Benjamin Otte
f9b7825a47 device: Inline function into return_if_fail() 2020-02-22 07:33:40 +01:00
Benjamin Otte
e3aee62b18 drop: Guard variable with correct compiler flags 2020-02-22 07:33:40 +01:00
Benjamin Otte
ce3ed45e81 surface: Inline function
Fixes compile error with -DG_DISBALE_CHECKS
2020-02-22 07:33:40 +01:00
Benjamin Otte
a12e563cd2 main: Don't synthesize crossing events when nothing changed
This was especially bad because it was confusing the event controllers
so much, they'd emit leave + enter events every time the mouse moved.
2020-02-22 07:33:40 +01:00
Benjamin Otte
a5e2275a72 stackswitcher: Use GdkDropControllerMotion
... and use one controller per button instead of using it on the
switcher and then going through lots of pain attempting to find the
right button for the location under the mouse.
2020-02-22 07:33:40 +01:00
Benjamin Otte
d680e2e344 Port simple cases to GtkDropControllerMotion 2020-02-22 07:33:40 +01:00
Benjamin Otte
2a8fd25a4b testsuite: Check proper notify emissions, too
This is in particular relevant for the ::is-focus property, because
updating that one doesn't cause enter/leave events.

But it also checks that notify and enter/leave happen in the right
order.
2020-02-22 07:33:40 +01:00
Benjamin Otte
34e5f36fdf Add GtkDropControllerMotion 2020-02-22 07:33:40 +01:00
Benjamin Otte
9223d1ee04 eventcontrollermotion: Fix docs 2020-02-22 07:33:40 +01:00
Benjamin Otte
fc43ec0bbc gtk: Bubble drag events like motion events
Emit crossing events - with a new GTK_CROSSING_DROP type - like we do
for motion events. There is no more special casing for them.

Note that the gesture has not been updated yet, so some obscure behavior
may occur.
2020-02-22 07:33:40 +01:00
Benjamin Otte
be4b34aa8f events: Use GdkDrop as event sequence
This allows treating drop events like touch events, which GTK groups by
event sequence.

It's a bit ugly that we just case the GdkDrop pointer, but event
sequences are only meant to be unique pointer ids, so it's fine.
2020-02-22 07:33:40 +01:00
Benjamin Otte
6f73a750a7 widget: Simplify adjust_allocation()
And in particular, only do it if the widget doesn't use ALIGN_FILL.

This avoids lots of measuring in the common case and speeds up
size_allocate() by about 25%.

And because size_allocate() is the bottleneck in the fishbowl, this also
gets ~25% more fishies.
2020-02-22 07:33:40 +01:00
Benjamin Otte
4128ee88b0 widget: Pull margin computation out of adjust_allocation
It's way cheaper to just do it.

Also simplifies adjust_size_allocation a lot.
2020-02-22 07:33:23 +01:00
Benjamin Otte
418bdc87ef sizerequest: Stop clamping for_size to natural size
Widgets should be given the actual size they will be allocated, so they
can do something with it.

If they want to clamp themselves to their natural size, nothing's
stopping them, they know their natural size after all.
2020-02-22 07:33:23 +01:00
Benjamin Otte
612ba7ec15 widget: Don't check for natives
It's the native's job to request a 1px x 1px size, not the job of
gtk_widget_size_allocate()

Also saves 10% of size_allocate() time because checking for an interface
is really expensive.
2020-02-22 05:50:07 +01:00
Benjamin Otte
f656cbdc5b Ensure all natives request at least a 1px wide surface
FIXME: Is this necessary?

Could the surfaces just clamp to 1x1 themselves?
We recently declared that surfaces can decide on whatever size they want
so natives need to inspect the size they requested anyway.
2020-02-22 05:50:07 +01:00
Matthias Clasen
3eea9f3e79 Merge branch 'color-float-fix' into 'master'
color chooser: Fix fallout from floatification

See merge request GNOME/gtk!1459
2020-02-22 03:19:01 +00:00
Matthias Clasen
9fa7a47081 color chooser: Fix fallout from floatification
We are using (dddd) variants to store colors in variants,
which is dangerous now that GdkRGBA members are just floats.

Avoid passsing the GdkRGBA members directly to any varargs
functions.
2020-02-21 19:56:44 -05:00
Matthias Clasen
13ed531301 Merge branch 'wip/xdg-popup-layout-no-op' into 'master'
gdk/wayland: Avoid relayout with the same properties

See merge request GNOME/gtk!1457
2020-02-22 00:27:59 +00:00
Matthias Clasen
7a28118f3a Merge branch 'wip/gdkpopuplayout-section' into 'master'
docs: Add GdkPopupLayout to gdk4-sections.txt

See merge request GNOME/gtk!1458
2020-02-22 00:26:42 +00:00
Jonas Ådahl
b4bce2ff8a docs: Add GdkPopupLayout to gdk4-sections.txt 2020-02-21 23:25:30 +01:00
Jonas Ådahl
2f13ac2e4d gdk/wayland: Avoid relayout with the same properties
When a popup is already showing, and gdk_surface_present_popup() is
called, if the layout didn't change, we're not really interested in
relayouting.

In the future, we'll be able to get notified if position of the popup
would change by some environmental changes, but until then, just don't
support it.
2020-02-21 21:55:16 +01:00
Jonas Ådahl
1d6100e7b0 gdk/popup-layout: Remove leftover struct field
The layouts never "seal", as they did in an earlier revision, so remove
the seal field.
2020-02-21 21:42:52 +01:00
Benjamin Otte
112bc964cb Merge branch 'wip/otte/for-master' into 'master'
surface: Don't take a display argument in gdk_surface_new_popup()

See merge request GNOME/gtk!1456
2020-02-21 20:35:47 +00:00
Benjamin Otte
5577cfa40c surface: Don't take a display argument in gdk_surface_new_popup()
The display can be taken from the surface, it must not be different.
2020-02-21 21:13:09 +01:00
Benjamin Otte
c73ac2ed70 Merge branch 'wip/otte/for-master' into 'master'
Wip/otte/for master

See merge request GNOME/gtk!1455
2020-02-21 18:24:56 +00:00
Benjamin Otte
7597f6b594 transform: Don't crash for gsk_transform_transform (id, id)
See attached tests
2020-02-21 18:30:13 +01:00
Benjamin Otte
b50093d044 transform: Make sure the identity transform is equal to NULL 2020-02-21 18:25:05 +01:00
Benjamin Otte
608e624ecf x11: When clearing old Drop, emit LEAVE event
This can happen when the old DND operation died (like due to a crash or
a broken XWayland compositor.
2020-02-21 18:19:16 +01:00
Benjamin Otte
808961564c gdk: Make DRAG_ENTER event take x/y coordinates
Make it mirror the behavior of ENTER/LEAVE events.
2020-02-21 18:19:16 +01:00
Benjamin Otte
41ef6e9fa5 transform: Add optimization for common case
Transforming identity by an other transform does not mean we need to
painstakingly apply the individual steps of other to construct a new
transform, it means we can just return other.

Or in math terms:
  I * B = B
so just return B.
2020-02-21 18:19:16 +01:00
Piotr Drąg
4180ad57bc Update POTFILES.in 2020-02-21 18:11:15 +01:00
Matthias Clasen
d7d7957b04 profiling: Avoid one extra printf
We already format the message, no need to use
printf again to combine that with the kind string.
2020-02-21 07:26:19 -05:00
Matthias Clasen
376f5eacbd profiling: Avoid criticals
With events no longer GObjects, the type class is
longer around for peeking.
2020-02-21 07:23:40 -05:00
Matthias Clasen
77e1fd01c3 Merge branch 'readonly-events-1' into 'master'
Redo events

See merge request GNOME/gtk!1443
2020-02-21 06:18:25 +00:00
Matthias Clasen
43aa6d9c49 docs: Remove some no-longer existing api 2020-02-21 00:51:04 -05:00
Matthias Clasen
5ebe5be225 Stop exporting gtk_get_event_widget
This is non-essential convenience API, and we
don't really expose events to applications anymore.
2020-02-21 00:51:03 -05:00
Matthias Clasen
1c7191f45c gtk-demo: Stop using gtk_get_event_widget
This is convenience api that will be going away.
2020-02-21 00:51:03 -05:00
Matthias Clasen
497a43a4ba gdk: Drop event structs from the headers
All events are GdkEvents now.
2020-02-21 00:51:03 -05:00