Commit Graph

53777 Commits

Author SHA1 Message Date
Timm Bäder
c8a936cdcc range: Always queue an allocate if the adjustment changed
The slider gets its new size in size-allocate, so we have to do this
even if the range has no origin.
2018-01-30 21:51:50 +01:00
Jason Gerecke
6fd6ff2ea1 wayland: Add support for BTN_STYLUS3
BTN_STYLUS3 is defined by the Linux 4.15 kernel and is sent when the
third button on a stylus is pressed. At the moment, only Wacom's "Pro
Pen 3D" has three stylus buttons. Pressing this button triggers a button
8 event to be sent under X11, so we use the same mapping here.

https://bugzilla.gnome.org/show_bug.cgi?id=790033
2018-01-30 21:32:07 +01:00
Nuclear Sunshine
cb5c739f93 Add AGPL3-only licence to GtkAboutDialog
https://bugzilla.gnome.org/show_bug.cgi?id=792793
2018-01-28 14:36:28 +00:00
Timm Bäder
228b35c111 gl: Add test case for clipped cross fade nodes 2018-01-27 12:19:22 +01:00
Timm Bäder
6e70079e63 gl renderer: Reset clip when drawing offscreen
Just like we reset the scissor test and the viewport, we also can't use
the current clip anymore in this case.
2018-01-27 12:13:37 +01:00
Timm Bäder
c1882fe44e GskRoundedRect: Fix GSK_ROUNDED_RECT_INIT macro
GskRoundedRect does not have a .rect member, it's 'bounds'. Also,
properly initialize all fields, i.e. all the corners.
2018-01-27 12:11:49 +01:00
Timm Bäder
684624005a gl renderer: Fix hidpi cairo node rendering
We can't just unconditionally create a larger texture here, since the
incoming cairo surface might have a device scale that doesn't fit our
scale_factor. Instead, look up the surface device scale and use that.
2018-01-27 11:06:38 +01:00
Timm Bäder
1fb5d389db gl renderer: Make width/height relation more obvious
In add_offscreen_ops, we use the max_x/min_x values for the texture and
viewport width, and the max_y/min_y for the texture and viewport height.
2018-01-27 11:00:59 +01:00
Timm Bäder
794d9d266e inspector: Actually call the pick() vfunc when picking
Otherwise, overridden pick vfuncs don't work and we e.g. pick widgets
scrolled away in a viewport.
2018-01-26 17:29:30 +01:00
Timm Bäder
60fdeda599 entry: Remove unused struct members 2018-01-26 17:29:30 +01:00
Timm Bäder
a29306cb1e menu: Simplify popup_at_rect
No need to keep a separate current_event variable around, we don't use
it anyway.
2018-01-26 17:29:30 +01:00
Matthias Clasen
f00f5508d4 gdk: Stop referring to ::key-press/release-event
These signals are going away, don't mention them in
the docs.
2018-01-24 12:04:32 +01:00
Matthias Clasen
063592f350 entry completion: Stop using key-press/release-event
We can use the existing ::event handler for this.
2018-01-24 12:04:27 +01:00
Timm Bäder
6806c28b1e gsk: Add test case for last commit 2018-01-23 21:46:31 +01:00
Timm Bäder
e3557f681c gl renderer: Fix outset shadow outline transform
This fixes hidpi blurred outset shadows
2018-01-23 21:46:31 +01:00
Emmanuele Bassi
f83b3c8af2 Enforce UTF-8 encoding when opening C files
We have a couple of Python 3.x scripts that parse C files, and since C
does not have any encoding, we need to force one ourselves, to avoid the
case when we're running the build in a non-UTF-8 locale.

https://bugzilla.gnome.org/show_bug.cgi?id=792497
2018-01-23 14:04:49 +01:00
Daniel Boles
b91fc17a19 Widget: Don’t call reset() on NULL EventController
GtkGesture is a GtkEventController. gtk_event_controller_dispose() calls
_gtk_widget_remove_controller(). That NULLs the pointer-to-Controller in
our EventControllerData but does not delete said ECData from our GList.

Subsequently, if that same Widget gets unparent()ed, that method calls
unset_state_flags(), which leads to doing reset_controllers() if we are
insensitive. Now, unlike most most other loops over the GList of ECData,
reset_controllers() does not skip nodes whose pointer-to-Controller is
NULL. So, we call gtk_event_controller_reset(NULL) and get a CRITICAL.

This surfaced in a gtkmm program. The Gesture is destroyed before the
Widget. The Widget then gets dispose()d, which calls unparent()… boom.
I didn’t find an MCVE yet but would hope this logic is correct anyway:

The simplest fix is to make the loop in gtk_widget_reset_controllers()
skip GList nodes with a NULL Controller pointer, like most other such
loops, so we avoid passing the NULL to gtk_event_controller_reset().

In other, live cases, _gtk_widget_run_controllers() loops over the GList
and removes/frees nodes having NULL Controllers, so that should suffice.
But this clearly was not getting a chance to happen in the failing case.

https://bugzilla.gnome.org/show_bug.cgi?id=792624
2018-01-22 19:10:58 +00:00
GNOME Translation Robot
37482c81c7 Update Esperanto translation
(cherry picked from commit 814c55d473)
2018-01-22 18:35:04 +00:00
Juan Pablo Ugarte
f2019e61db GtkGestureMultiPress: check event state before emiting released signal
Fix bug 771986 "Inconsistent 'row-activated' signal emission before \
drag'n'drop, 'activate-on-single-click'=TRUE, 'reorderable'=TRUE"
2018-01-22 15:52:58 +01:00
Timm Bäder
fbd79d8fea widget: Only initialize bounds rect if necessary
We only use the graphene_rect_t version of the offset_clip for the
fallback cairo nodes.
2018-01-21 20:37:46 +01:00
Timm Bäder
fb81686a89 vulkan: Fix release builds 2018-01-21 15:23:17 +01:00
Timm Bäder
d6c2ef3b71 combobox: Remove some unneeded includes 2018-01-21 11:01:32 +01:00
Simon McVittie
e22990302a Set GDK_WINDOW_STATE_TILED if any edge is tiled
This state flag is used in several places in GTK+, for example to
ignore RESIZE_INC hints if tiled. Setting it is also necessary for
backwards compatibility with applications that changed their behaviour
when tiled, such as GNOME Terminal and its MATE fork.

Signed-off-by: Simon McVittie <smcv@debian.org>

https://bugzilla.gnome.org/show_bug.cgi?id=789357
2018-01-20 13:10:49 +01:00
Georges Basile Stavracas Neto
42ff22f222 display-x11: Unset tiled state if _GTK_EDGE_CONSTRAINTS is supported
Commit c415bef5de introduced support for the new _GTK_EDGE_CONSTRAINTS
atom. If the compositor supports that atom, however, we were always
setting the tiled state, even if no actual tiling information is
available, where the correct action is to completely remove any traces
of the tiled state.

Fix that by correctly removing the tiled state when compositor supports
_GTK_EDGE_CONSTRAINTS Xatom.

https://bugzilla.gnome.org/show_bug.cgi?id=788516
2018-01-20 13:10:42 +01:00
Timm Bäder
4d36a0bf35 entrycompletion: Realize toplevel before attempting a grab
Otherwise, gtk_widget_get_window returns NULL and we can't successfully
perform a grab via the later gdk_set_grab call. This fixes the entry
completion in the file chooser not working.
2018-01-19 22:39:23 +01:00
Matthias Clasen
af0d876bb7 tests: Remove some unneeded gtk_widget_show calls
Widgets are visible by default now.
2018-01-19 23:29:13 +03:00
Matthias Clasen
ffef28a7e8 iconview: Fix updates with filter models
Filter models rely on views taking a ref on every node
they care about. GtkIconView was not doing that. Amazingly,
this has never shown up in a bug so far, until I spotted
the fallout in gnome-font-viewer.
2018-01-19 23:29:13 +03:00
Matthias Clasen
f942d6f53c Add a test for ::row-changed vs node refs
Test that filter models propagate ::row-changed if there is
an external reference on the node, and not otherwise. This
is showing up in buggy icon view behaviour, where the icon
view is not redrawing if the content changes in a model that
is below a filter model.
2018-01-19 23:29:13 +03:00
Carlos Garnacho
7d9af6d700 gtkwindow: Disconnect GdkSeat::device-removed callback on finalize
Otherwise dangling callbacks may lead to crashes.
2018-01-19 18:47:21 +01:00
Timm Bäder
8f4e0705dc gl renderer: Fix shadow node child offset
We shouldn't apply the shadow offset when drawing the child offscreen,
instead apply it afterwards when we draw it to the current render
target.
2018-01-19 15:00:22 +01:00
Timm Bäder
87bdfbb02c testsuite: Add another gl renderer test case 2018-01-19 14:59:31 +01:00
Timm Bäder
e4be37eb60 linkbutton: Only set widget cursor once 2018-01-19 13:21:41 +01:00
Timm Bäder
8224e7ac72 inspector: Allow picking insensitive widgets
The default gtk_widget_contains/gtk_widget_pick don't consider
insensitive widgets.
2018-01-19 10:16:15 +01:00
Timm Bäder
2dca8f935c csswidgetnode: Avoid some unnecessary work
The later code would just ref both styles and not do anything else.
2018-01-19 09:57:49 +01:00
Timm Bäder
f595c0dc1b widget-factory: Fix some layout issues
We have to explicitly set some of these to their default values so
expand-set is TRUE and the boxes stop propagating their expansion state
up the hierarchy.
2018-01-19 09:53:39 +01:00
Timm Bäder
3265013268 textview: Remove some stray debugging output
Leftover from 7046463b88
2018-01-19 08:17:03 +01:00
Matthias Clasen
351559fcfa Simplify all ui files again
Now even simpler!
2018-01-18 17:53:44 -05:00
Matthias Clasen
6c805ecb0f builder-tool: Try harder to find types
If g_type_from_name fails, try gtk_builder_get_type_from_name
before giving up. This fixes cases like GtkPrinterOptionWidget.
2018-01-18 17:45:12 -05:00
Timm Bäder
8a432b42a2 window: Ignore gtk_window_close calls from close-request handlers 2018-01-18 15:10:49 +01:00
Timm Bäder
aee4634ee5 widget: Always assign values to out parameter in translate_coordinates
safe guard against people using the returned coordinate values without
checking the return value of gtk_widget_translate_coordinates.
2018-01-18 14:45:13 +01:00
Timm Bäder
cc9a4c1720 widget: Initialize a local variable
We will later pass this variable on to some other functions, so be safe
against them using the value.
2018-01-18 14:45:13 +01:00
Timm Bäder
d607312080 aboutdialog: Only close on delete events
Clicking on the Credits button should not close the dialog.
2018-01-18 14:45:08 +01:00
Timm Bäder
41dac661a0 fontchooswerwidget: Center spinbutton next to scales vertically 2018-01-18 09:40:19 +01:00
Timm Bäder
41a922928e gl renderer: Render GL textures upside down
These come from an FBO so we need to flip the texture coords on the y
axis, just like we do everywhere else.
2018-01-18 08:21:11 +01:00
Matthias Clasen
182272c0ab Revert "inspector: Stop adding event controllers to the object tree"
This reverts commit 8f3cb2658a.

This didn't quite work out, since being in the object tree is
a prerequisite for showing up in the property editor.
2018-01-17 23:49:17 -05:00
Matthias Clasen
e1d81d096c Document new texture api 2018-01-17 21:45:08 -05:00
Matthias Clasen
47b7bfd2ba Use the new api to release resources
When we unrealize a GL area with outstanding textures,
call gdk_texture_release_gl on them to avoid later crashes.
2018-01-17 20:19:19 -05:00
Matthias Clasen
5e302ae2cc Add a way to release GL resources
The inspector may hold on to render nodes and textures
beyond the lifetime of the widget (and thus the GL
resources). To handle this situation, allow the widget
to explicitly release the GL resources, and make
the texture available on the clent-side as a cairo
surface. This lets the recorder still show the content
after the widget is gone.
2018-01-17 20:15:45 -05:00
Matthias Clasen
34c63b8e4f glarea: Drop the dispose vfunc
This was causing us to leak, in the following scenario:
1) gtk_widget_destroy is called on a GL area
2) dispose is run and clears the context
3) the GL area is unrealized, but the context is already cleared,
   so we leak all the GL buffers
2018-01-17 19:49:52 -05:00
Matthias Clasen
0429008b16 glarea: Always delete textures on unrealize
We need to make the context current for deleting
textures as well, so just do it unconditionally.
2018-01-17 19:49:05 -05:00