Commit Graph

48909 Commits

Author SHA1 Message Date
Jiri Grönroos
ef7ee16368 Update Finnish translation 2017-08-03 09:51:38 +00:00
Timm Bäder
8a17848f02 entry: get_icon_area returns in entry coordinates
Document what the returned coordinates are relative to.
2017-08-03 10:23:27 +01:00
Daniel Boles
5acee3a3e0 Layout: Tweak documentation blurb
Being addable to a ScrolledWindow is not interesting; now that SW
auto-adds a Viewport if needed, so can DrawingArea and any other widget.

Mention GtkFixed in case the reader just wants that bit of functionality
2017-08-03 10:18:14 +01:00
Olivier Fourdan
1c23bce350 wayland: add shortcut inhibitor support
This adds support for the shortcut inhibitor protocol in gdk/wayland
backend.

A shortcut inhibitor request is issued from the gdk wayland backend for
both the older, deprecated API gdk_device_grab() and the new gdk seat
API gdk_seat_grab(), but only if the requested capability is for the
keyboard only.

https://bugzilla.gnome.org/show_bug.cgi?id=783343
2017-08-02 12:38:52 +02:00
Daniel Boles
7dd3349751 bindings: Avoid iterating array if it is never set
If query.return_type is not one we want, binding_compose_params() is
not called, and so params remains a NULL pointer. However, the code was
then unconditionally iterating it regardless. Don't if it is still NULL.

CID 1452218 (#1 of 1): Explicit null dereferenced (FORWARD_NULL)
15. var_deref_op: Dereferencing null pointer params.
2017-08-01 20:41:23 +01:00
Daniel Boles
6063a89235 cssselector: Ensure we do not index out of bounds
This would only happen if the last element was deprecated, but it should
be avoided anyway.

CID 1388852 (#1 of 1): Out-of-bounds read (OVERRUN)
12. overrun-local: Overrunning array pseudo_classes of 16 32-byte
elements at element index 16 (byte offset 512) using index i + 1U (which
evaluates to 16).
2017-08-01 20:16:40 +01:00
Daniel Boles
a381a06b12 Notebook: Remove null check after dereference
This function clearly assumes the parameter children cannot be NULL, and
the call sites seem to perform enough checks to confirm this.

CID 1388869 (#1 of 1): Dereference before null check (REVERSE_INULL)
check_after_deref: Null-checking children suggests that it may be null,
but it has already been dereferenced on all paths leading to the check.
2017-08-01 20:15:15 +01:00
Daniel Boles
cd7e5fae22 Calendar: Add default case to appease Coverity
CID 1432024 (#1 of 1): Uninitialized scalar variable (UNINIT)
2. uninit_use_in_call: Using uninitialized value rect.x when calling
calendar_arrow_rectangle.

Add a default case to the switch which will bail out with
g_assert_not_reached(), which should reassure Coverity that the method
is always called with a valid value that is handled in the switch.
2017-08-01 20:15:15 +01:00
Daniel Boles
5e6293e54f cssbordervalue: Fix possible use of uninitialised
If value->values[i] is NULL, then values[i] was left uninitialised.
The code then reads each element of values[].

CID 1432029 (#1 of 1): Uninitialized pointer read (UNINIT)
11. uninit_use: Using uninitialized value values[i].
2017-08-01 20:12:44 +01:00
Timm Bäder
0b230d34c4 scrolledwindow: Remove useless function call
We never use the result.
2017-08-01 19:10:10 +01:00
Daniel Boles
1088056a5d Widget: Do not dereference before type check 2017-08-01 18:54:12 +01:00
Timm Bäder
505d5e41c2 gtkapplication: g_dbus_proxy_new_sync can return NULL
Specifically, in the case where @error is set.
2017-08-01 18:54:12 +01:00
Daniel Boles
df10ec7b9b Entry: Fix unset icon tooltip hiding Entry tooltip
Our ::query-tooltip handler first checks whether the pointer is over any
of the icons, returning their tooltip if so, and if not chains up to
Widget::query-tooltip in order to show the text for the widget overall.

But ensure_has_tooltip(), which exists to update :has-tooltip based on
whether ::query-tooltip is needed, only set :has-tooltip to TRUE if any
icon had a tooltip, without caring whether the widget as a whole does.

That is asymmetrical and meant that if the Entry had a tooltip, but
subsequently all icons had their tooltips unset, :has-tooltip would be
set to FALSE, and hence the tooltip for the widget would become lost.

The fix is to set :has-tooltip to TRUE if the widget has a tooltip of
its own, and we only need to check the icons if that is not the case.

https://bugzilla.gnome.org/show_bug.cgi?id=785672
2017-08-01 18:10:38 +01:00
Daniel Boles
ce792384c5 Entry: Warn about corner case hiding icon tooltips
https://bugzilla.gnome.org/show_bug.cgi?id=785672#c4
2017-08-01 18:10:38 +01:00
Daniel Boles
3680e3d40b Entry: Fix get_icon_at_pos()
This was comparing the input position, which is documented as being
relative to the top-left of the Entry allocation, to icon allocations
that were not adjusted accordingly. This could result in tooltips for
icons not being shown in various conditions, since the ::query-tooltip
handler uses get_icon_at_pos() to check whether to show an icon tooltip.

The fix is to compare to the icon border box, not border allocation, as
CssGadget::get_border_box() adjusts relative to the widget. Better yet:
we can just make CssGadget::border_box_contains_point() compare for us.

Delegating to Entry::get_icon_area(), which manually reimplements
CssGadget::get_border_box(), would also work, but this is simpler.

https://bugzilla.gnome.org/show_bug.cgi?id=780938
2017-07-31 20:05:11 +01:00
Daniel Boles
ad06a08b99 testentryicons: Set tooltips on all icons
Just to test tooltips in all cases; what was already here
should have been sufficient, but this doesn't hurt.

While here, also add some instructive placeholder text.

https://bugzilla.gnome.org/show_bug.cgi?id=780938
2017-07-31 20:05:11 +01:00
Timm Bäder
d9170e1978 entry: make sure priv->current_pos is valid
We can e.g. get the entry dispose()d and a focus_out event after that
(because the toplevel unsets the focus which previously was the entry).
We then later use priv->current_pos in a call to pango API which makes
sure the given index is valid for the given layout. Since we lazily
create a GtkEntryBuffer in get_buffer() and a PangoLayout lazily in
gtk_entry_create_layout, these 2 are always valid but don't match
priv->current_pos in this situation.

Fix this by resetting priv->current-pos in dispose().

https://bugzilla.gnome.org/show_bug.cgi?id=785255
2017-07-31 20:05:04 +01:00
Matej Urbančič
a30220d4e3 Updated Slovenian translation 2017-07-27 15:53:08 +02:00
Matej Urbančič
c0d88a5b7b Updated Slovenian translation 2017-07-27 15:51:09 +02:00
Carlos Garnacho
9b032073cb gtkrange: Instaurate GTK+ grabs while manipulating ranges
It should not be necessary for most situations, except while there's
GDK grabs coercing events in a different way.

https://bugzilla.gnome.org/show_bug.cgi?id=782870
2017-07-26 12:53:33 +02:00
Carlos Garnacho
54c26e0983 gtkgesture: Do not ignore events from other GdkWindows than the widget's
There's GDK grab situations (eg. pointer motion outside the grab window
in combination with a GTK+ grab) where a gesture may receive events from
windows that are not the widget's.

The _update_widget_coordinates() still does work for those situations, so
just let these events go through instead of ignoring them.

https://bugzilla.gnome.org/show_bug.cgi?id=782870
2017-07-26 12:48:44 +02:00
Carlos Garnacho
d6d4217f3d gtklabel: Fix touch link handling under wayland
Refactor the code updating the active link under the current coordinates
into a separate function, and call it on GtkGestureMultiPress::pressed
so the link is updated on GDK_TOUCH_BEGIN. Based on a patch by
Jan-Michael Brummer <jan.brummer@tabos.org>.

https://bugzilla.gnome.org/show_bug.cgi?id=776903
2017-07-25 18:36:12 +02:00
Carlos Garnacho
0daf796763 gtklinkbutton: Set cursor on button's event window
Setting the cursor on the widget window (i.e. the parent widget's) is
finicky because the cursor needs to be updated on crossing events, and
will yield the wrong result for other master devices that happen to be
in other areas of the same parent widget's window.

Just set it always on the event window created by the GtkButton parent
class. That window was causing the crossing events, so the rectangle
that gets the hand cursor set will be the same size, and we don't need
to track pointer crossing state that way.

https://bugzilla.gnome.org/show_bug.cgi?id=785375
2017-07-25 18:36:12 +02:00
Carlos Garnacho
b53a6fb092 wayland: Clear tablet tool cursor on proximity out
This ensures that the tablet tool will get the cursor updated even if it
happens to fall within the same window again on the next proximity in.

https://bugzilla.gnome.org/show_bug.cgi?id=785375
2017-07-25 18:36:12 +02:00
Carlos Garnacho
18eeaf704e gdkwindow: Update cursor for tablet tools in the window
This check must be done explicitly on Wayland as the master device for
tablet tools differ from the Core Pointer. This ensures that whenever a
tablet tool is inside a window and the cursor is programmatically changed,
it will be visually updated too.

https://bugzilla.gnome.org/show_bug.cgi?id=785375
2017-07-25 18:36:12 +02:00
Carlos Garnacho
3f09833253 wayland: Observe GDK_SEAT_CAPABILITY_TABLET_STYLUS on gdk_seat_get_slaves()
This flag wasn't being honored so far...
2017-07-25 15:35:41 +02:00
Jason Gerecke
32919a4a02 wayland: Implement support for tablet wheel scrolling
Adds support for creating scroll events from Wayland tablet wheel events.
Even though no Wacom tablet puck has a smooth-scrolling wheel, both event
types need to be generated to make the upper layers happy.

https://bugzilla.gnome.org/show_bug.cgi?id=783716
2017-07-20 14:11:26 +02:00
Carlos Garnacho
e6863da8fc wayland: Make function to create scroll event more generic
Add GdkWaylandPointerData and GdkDevice arguments so it can be
used across master devices.

https://bugzilla.gnome.org/show_bug.cgi?id=783716
2017-07-20 14:11:26 +02:00
Jason Gerecke
3a83de295d wayland: Get implicit grab serial information from tablet devices
If a tablet device is used to perform actions like window moving or resizing,
GTK must provide the correct implicit grab serial number over Wayland to Mutter
in order for the action to succeed. This commit adds tablet support to the
implicit serial getters.

https://bugzilla.gnome.org/show_bug.cgi?id=777333
2017-07-20 12:23:15 +02:00
Jonas Ådahl
376ff1ae60 wayland: Throttle system bell requests
If a bad behaving application tries to make the window/display beep too
often, throttle the beep requests so that we don't end up filling the
Wayland socket queue.

The throttle is set to 50 beeps per second, which far more beeps than
will ever make any sense from a user experience point of view, but will
avoid terminating due to an excessive amount of requests.

https://bugzilla.gnome.org/show_bug.cgi?id=778188
2017-07-20 10:03:51 +08:00
Jonas Ådahl
f78585b7c3 wayland: Make beep requests go through the GdkDisplay
This way we can add things like throttling.

https://bugzilla.gnome.org/show_bug.cgi?id=778188
2017-07-20 10:03:43 +08:00
Matthias Clasen
59857e8f20 3.22.17 2017-07-18 22:55:39 -04:00
Matthias Clasen
448d76b8e8 update expected test results 2017-07-18 22:55:39 -04:00
Timm Bäder
65b6aafb45 filechooserwidget: Let the rename entry hexpand
This makes a difference with other locals where error messages are
longer than the standard width of entry+spacing+button.
2017-07-18 15:11:36 -04:00
Iñaki García Etxebarria
5edeba5965 Add nullable return annotation to gtk_text_mark_get_name
https://bugzilla.gnome.org/show_bug.cgi?id=781936
2017-07-18 15:10:24 -04:00
Iñaki García Etxebarria
743eaeecf2 Add nullable return annotation to gtk_notebook_get_tab_label
https://bugzilla.gnome.org/show_bug.cgi?id=781935
2017-07-18 15:08:02 -04:00
Cody Russell
68b92cc6ef Update API for El Capitan+
Use NSAnimationContext where possible.
2017-07-18 14:54:11 -04:00
Cody Russell
fc1f0b171c os x: Add new versions 2017-07-18 14:46:45 -04:00
Daniel Aleksandersen
ff982658ee Update the URLs of known licenses to HTTPS
Use HTTPS by default for security/privacy. Avoids slow redirects.

https://bugzilla.gnome.org/show_bug.cgi?id=766517
2017-07-18 14:36:02 -04:00
Arun Raghavan
f05e6b2936 gtkapplication: Mark gtk_application_get_active_window() as nullable
https://bugzilla.gnome.org/show_bug.cgi?id=784888
2017-07-18 14:35:39 -04:00
John Ralls
7e362638ac Copy gtk_clipboard_get_default implementation to gtkclipboard-quartz.c
Fixes bug 784323.
2017-07-18 11:16:58 -07:00
Piotr Drąg
4b6c68b51e Update POTFILES.in 2017-07-18 19:53:57 +02:00
Tom Schoonjans
8c691b8232 GtkFileChooserNativeWin32: add support for get_filter and set_filter
https://bugzilla.gnome.org/show_bug.cgi?id=784723
2017-07-18 13:48:13 -04:00
Tom Schoonjans
626ac112f0 testgtk.c: native file chooser filter changes
Set the filter before showing the dialog
Afterwards, fetch the last active filter and display its name.

https://bugzilla.gnome.org/show_bug.cgi?id=784723
2017-07-18 13:48:13 -04:00
Tom Schoonjans
291eda6675 GtkFileChooserNativeQuartz: add support for get_filter and set_filter
https://bugzilla.gnome.org/show_bug.cgi?id=784723
2017-07-18 13:48:13 -04:00
Tom Schoonjans
2f6c90636d GtkFileChooserNative: documentation updated
https://bugzilla.gnome.org/show_bug.cgi?id=784723
2017-07-18 13:48:13 -04:00
Tom Schoonjans
db87140cf3 GtkFileChooserNativeQuartz: add support for filters
Includes:
* Simple glob patterns (*.ext, *.*,...)
* MIME types
* pixbuf formats

https://bugzilla.gnome.org/show_bug.cgi?id=784723
2017-07-18 13:48:13 -04:00
Tom Schoonjans
6d104813cc GtkFileChooserNativeQuartz: add partial support for extra widget
When the extra widget is a GtkLabel, then its text will be displayed as
a message in the NSSavePanel or NSOpenPanel

https://bugzilla.gnome.org/show_bug.cgi?id=784723
2017-07-18 13:48:13 -04:00
Tom Schoonjans
af7022988c GtkFileChooserNativeQuartz: add support for GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER
Which is via NSOpenPanel, not NSSavePanel...

https://bugzilla.gnome.org/show_bug.cgi?id=784723
2017-07-18 13:48:13 -04:00
Tom Schoonjans
ce4c9a9ad6 GtkFilechooserNative: add macOS support
Based on the Win32 implementation, as well as the macOS file chooser
from
https://github.com/GNOME/gedit/blob/master/gedit/gedit-file-chooser-dialog-osx.[ch]
Not fully tested yet, but working properly so far.
TODO: filter support, extra widget (label), documentation...

https://bugzilla.gnome.org/show_bug.cgi?id=784723
2017-07-18 13:48:13 -04:00