Commit Graph

53803 Commits

Author SHA1 Message Date
Timm Bäder
8f7a8ada18 widget: Don't call snapshot vfunc if width or height are 0
The result won't be visible anyway. This also prevents problems with
widgets that create some resource the size of the widget, like
GtkGLArea. It also keeps us from snapshotting revealers with
size 0.
2018-02-03 12:22:52 +01:00
Timm Bäder
f52100c46e iconbrowser: setup image dnd for image6
Otherwise the we fail to set the drag source icon name later on.
2018-02-03 12:22:46 +01:00
Emmanuele Bassi
2432e53652 Remove all gdk_threads_* entry points
Now that we don't use them anywhere, it's time for them to go.

https://bugzilla.gnome.org/show_bug.cgi?id=793124
2018-02-03 12:07:10 +01:00
Emmanuele Bassi
888dfe499d Drop the Big GDK Lock
GDK has a lock to mark critical sections inside the backends.
Additionally, code that would re-enter into the GTK main loop was
supposed to hold the lock.

Back in the Good Old Days™ this was guaranteed to kind of work only on
the X11 backend, and would cause a neat explosion on any other GDK
backend.

During GTK+ 3.x we deprecated the API to enter and leave the critical
sections, and now we can remove all the internal uses of the lock, since
external API that uses GTK+ 4.x won't be able to hold the GDK lock.

https://bugzilla.gnome.org/show_bug.cgi?id=793124
2018-02-03 12:07:10 +01:00
Emmanuele Bassi
c655759cef Replace gdk_threads_add_timeout* with g_timeout_add()
The main GDK thread lock is not portable and deprecated.

The only reason why gdk_threads_add_timeout() and
gdk_threads_add_timeout_full() exist is to allow invoking a callback
with the GDK lock held, in case 3rd party libraries still use the
deprecated gdk_threads_enter()/gdk_threads_leave() API.

Since we're removing the GDK lock, and we're releasing a new major API,
such code cannot exist any more; this means we can use the GLib API for
installing timeout callbacks.

https://bugzilla.gnome.org/show_bug.cgi?id=793124
2018-02-03 12:06:58 +01:00
Emmanuele Bassi
334acbfc39 Replace gdk_threads_add_idle* with g_idle_add()
The main GDK thread lock is not portable and deprecated.

The only reason why gdk_threads_add_idle() and
gdk_threads_add_idle_full() exist is to allow invoking a callback with
the GDK lock held, in case 3rd party libraries still use the deprecated
gdk_threads_enter()/gdk_threads_leave() API.

Since we're removing the GDK lock, and we're releasing a new major API,
such code cannot exist any more; this means we can use the GLib API for
installing idle callbacks.

https://bugzilla.gnome.org/show_bug.cgi?id=793124
2018-02-03 12:06:58 +01:00
Benjamin Otte
dfc131c7ec toolpalette: Remove
The widget was basically unmaintained since GTK 3.0 and the only known
user was Glade.
2018-02-03 11:52:37 +01:00
Benjamin Otte
55874470ff gtk: Remove GtkRecentChooser
It's not used any more, recent files are only used by the filtchooser
and that one uses GtkRecentManager directly.
2018-02-02 23:01:31 +01:00
Benjamin Otte
bb8baa2b76 tests: Unrealize renderer
Renderers must be unrealized these days.
2018-02-02 15:34:34 +01:00
Benjamin Otte
38b25599d8 texture: Add sanity checks to constructors
width, height and GL texture ID may not be 0, so return_if_fail() if
they are.
2018-02-02 14:59:23 +01:00
Benjamin Otte
df0b4d6684 texture: Make the texture id a guint
Texture IDs are unsigned, so treat them like that.
2018-02-02 14:59:23 +01:00
Emmanuele Bassi
fcaa9aa22d Rename GtkActionMuxer's private header
Follow the naming policy for private headers.
2018-02-02 10:28:17 +01:00
Emmanuele Bassi
1ed17df7a0 Rename GtkActionHelper private header
Follow the naming scheme for private headers.
2018-02-02 10:28:17 +01:00
Emmanuele Bassi
0ec744a3a5 Split list of sources
We need to have two lists: one, with the list of sources that need to be
introspected; and one with the list of sources that contain only private
symbols.

This reduces the amount of source files that the introspection scanner
needs to traverse, and thus the build time.
2018-02-02 10:28:17 +01:00
Emmanuele Bassi
b8828023e6 docs: Annotate gdk_keymap_get_display()
Avoid a warning from the introspection scanner.
2018-02-01 16:13:53 +01:00
Emmanuele Bassi
3a2aa2bd80 Remove unnecessary gtk-doc stanza
The places sidebar is not a publicly documented API, so there's no need
to use a gtk-doc stanza — especially if the syntax of the stanza is
wrong.
2018-02-01 16:08:51 +01:00
Emmanuele Bassi
a379ddefc3 Remove leading underscore from private symbols
There's no need to do that any more, as only explicitly annotated
symbols are exported.
2018-02-01 16:05:58 +01:00
Emmanuele Bassi
fe142b10bf Rename gtkiconcachevalidator.h
Follow the same convention for private headers as newer parts of GTK.
2018-02-01 16:01:38 +01:00
Emmanuele Bassi
e090c1f1a9 Rename gtkiconcache.h
The gtkiconcache.h header is private, so rename it to follow the naming
scheme for private headers.
2018-02-01 15:34:57 +01:00
Emmanuele Bassi
a313417879 Replace boilerplate in GtkIcon
Be a good GObject citizen and use G_DECLARE_FINAL_TYPE instead of
writing the usual GObject boilerplate.
2018-02-01 15:30:39 +01:00
Matthias Clasen
8916ff8ffe iconview: Fix a problem with the previous change
After commit ffef28a7e8,
gtk-icon-browser was spewing critical warnings when
changing sections. Avoid that by respecting the return
value of gtk_tree_model_get_iter.
2018-01-31 17:44:26 +01:00
Benjamin Otte
02892c59d1 dnd: Remove unused member variable 2018-01-31 13:21:26 +01:00
Benjamin Otte
bdd2f68ab5 dnd: Move GdkDragProtocol to X11
It's not needed in the generic implementation, so don't have it there.
2018-01-31 13:21:26 +01:00
Benjamin Otte
3e0fab6b93 dnd: Remove 2 vfuncs that aren't needed
They're only used inside the X11 backend, and the backend can just call
its own function.
2018-01-31 13:21:26 +01:00
Timm Bäder
e8986d18c2 icon browser: Remove usage of stock-size property
Does not exist anymore.
2018-01-30 21:51:59 +01:00
Timm Bäder
972c0fa998 Revert "menu: Simplify popup_at_rect"
This reverts commit a29306cb1e.
2018-01-30 21:51:59 +01:00
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