Commit Graph

21805 Commits

Author SHA1 Message Date
Matthias Clasen
184b2cce72 Merge branch 'gtk-2-24' into 'gtk-2-24'
Fix some compiler warnings in modules/other/gail/gailtreeview.c

See merge request GNOME/gtk!239
2018-07-20 14:23:29 +00:00
Brady Minardi
8f8336cd94 modules/other/gail/gailtreeview.c: Incorporate review suggestions
Incorporate review suggestions by Emmanuele Bassi.
2018-07-14 14:45:28 +00:00
Brady Minardi
4d37ee2e79 modules/other/gail/gailtreeview.c: Fix -Wunused-but-set-variable warning 2018-07-14 08:00:56 +00:00
Brady Minardi
8715570f45 modules/other/gail/gailtreeview.c: Fix -Waddress warning 2018-07-14 07:56:39 +00:00
Matthias Clasen
0d8ba4cbf9 Merge branch 'window-activate-grab-2-again' into 'gtk-2-24'
gdk: activate window on keyboard grabs

See merge request GNOME/gtk!177
2018-07-02 17:19:27 +00:00
Matthias Clasen
ad3d2218bf Merge branch 'dboles/gtk2-filechooser-bookmark-null-name' into 'gtk-2-24'
FileChooserDefault: Avoid printf()ing a NULL char*

See merge request GNOME/gtk!213
2018-06-23 20:44:18 +00:00
Daniel Boles
168434c4a1 FileChooserDefault: Avoid printf()ing a NULL char*
If the name of the bookmark is NULL, using it with the printf %s format
specifier is undefined behaviour per the C Standard. Besides, it would
result in a completely unhelpful tooltip even if it were well-defined.

We already have an else case for when nothing is selected, which avoids
trying to use the name, so ensure we go there if it's NULL or empty too.

https://gitlab.gnome.org/GNOME/gtk/issues/1169
2018-06-22 15:10:56 +01:00
Matthias Clasen
3c92c216a0 Merge branch 'window-activate-grab-2-again' into 'gtk-2-24'
gdk: activate window on keyboard grabs

See merge request GNOME/gtk!177
2018-06-18 12:20:51 +00:00
Samuel Thibault
853f786727 gdk: activate window on keyboard grabs
In 01455399e8 ("gdk: do not deactivate surface on keyboard grabs"), we
made gdk avoid deactivating surfaces when another application takes a
keyboard grab, by using has_focus_window instead of has_focus. That however
broke activating surfaces when the gdk application acquired a grab itself,
in which case has_focus_window is false but has_focus is true.

We thus actually need to use both: surfaces should be activated either
because we have normal keyboard focus, or because we grabbed the keyboard.

This also renames HAS_FOCUS to APPEARS_FOCUSED to better reflect its
role.

Fixes #85

(cherry picked from commit 3287ac96e02ff236d74db10164c5b0c1e7b2b0bf)
(cherry picked from commit 039285deb92b6baf6ef594b0d718e8f7a7e1d0ac)
2018-06-18 10:34:56 +02:00
Benjamin Otte
48821a76c6 Merge branch 'gtk2-icon-fix' into 'gtk-2-24'
Fix incorrect optimization in find_builtin_icon().

See merge request GNOME/gtk!154
2018-05-16 12:54:32 +00:00
Benjamin Otte
9b218aff66 Merge branch 'gtk2-gcc-warning-fix' into 'gtk-2-24'
Fix compiler warnings with GCC 8.1.

See merge request GNOME/gtk!155
2018-05-16 12:45:44 +00:00
John Lindgren
889a63dffc Fix compiler warnings with GCC 8.1.
GCC 8.1 added some new warnings, including warning about parentheses
with no effect in variable declarations.  GTK2 headers have a few of
these, which produce a lot of warnings in projects using GTK2.

The warnings look like:
/usr/include/gtk-2.0/gtk/gtkfilechooserbutton.h:59:8: warning:
unnecessary parentheses in declaration of ‘__gtk_reserved1’ [-Wparentheses]
   void (*__gtk_reserved1);
        ^

Removing the parentheses is harmless and fixes the warnings.
2018-05-15 21:52:15 -04:00
John Lindgren
9ce6f8086e Fix incorrect optimization in find_builtin_icon().
When we found an icon with exactly the requested size, we'd stop
searching immediately (good), but we'd neglect to set the returned
min_difference to 0 (bad).  This caused theme_lookup_icon() to
prefer other, potentially much worse, matches over the exact one.

Cherry-picked from 5aa939dc (gtk-3-22)

https://bugzilla.gnome.org/show_bug.cgi?id=792738
2018-05-15 21:35:21 -04:00
Benjamin Otte
5edb37444b Merge branch 'window-activate-grab-2-3' into 'gtk-2-24'
gdk: do not deactivate window on keyboard grabs

See merge request GNOME/gtk!128
2018-04-30 09:36:11 +00:00
Samuel Thibault
00b17063ac gdk: do not deactivate surface on keyboard grabs
When pressing e.g. a window manager shortcut, which acquires keyboard grab,
Xorg would send FocusOut NotifyGrab then FocusIn NotifyUngrab.  Currently
gdk would then deactivate the current surface, which makes accessibility
screen readers think that we have switched to a non-accessible application
and came back again, and thus reannounce the application frame etc. which we
don't want when e.g. just raising volume.

And actually, receiving FocusOut NotifyGrab does not mean losing the
X focus, it only means an application aqcuired a grab, i.e. it is
temporarily stealing keyboard events. On Wayland, this isn't even
notified actually.

This commit makes gdk only deactivate surfaces when there was an actual
focus switch to another window, as determined by has_focus_window (instead
of just has_focus), which happens either normally through FocusOut with
NotifyNormal, or during grabs through FocusOut with NotifyWhileGrabbed.

Fixes #85

(cherry picked from commit 01455399e8)
2018-04-30 11:20:57 +02:00
Emmanuele Bassi
c0ea27505c Merge branch 'fix/gtk-symbols-for-glib-2.54.3' into 'gtk-2-24'
Make gtk+-2.24.31 compatible with the changed API of glib-2.54.3

See merge request GNOME/gtk!67
2018-04-24 08:45:59 +00:00
Emmanuele Bassi
e5c3b62ddd Merge branch 'm4macros-gtk2' into 'gtk-2-24'
[gtk2] m4macros: Set a serial number

See merge request GNOME/gtk!104
2018-04-17 15:19:18 +00:00
Simon McVittie
acb78c9c60 m4macros: Set a serial number
When a project has a bundled copy of our macro included in tarball
source releases, typically in a m4/ or aclocal/ directory, aclocal
uses the serial number to determine whether the system copy in
/usr/share/aclocal is newer or older than the bundled copy. Without
a serial number, the bundled copy will always be used and will not
be overwritten, even if it is outdated.

Signed-off-by: Simon McVittie <smcv@debian.org>
2018-04-06 11:37:07 +01:00
Matthias Clasen
84a665f7f7 Merge branch 'gtk2-am116' into 'gtk-2-24'
build: support automake 1.16

See merge request GNOME/gtk!88
2018-03-30 20:43:17 +00:00
Dominique Leuenberger
2dbf31c0ea build: support automake 1.16 2018-03-27 16:43:23 +02:00
Dennis Schridde
88bb7ecc47 Make gtk+-2.24.31 compatible with the changed API of glib-2.54.3
glib-2.54.3 changed API, compared to glib-2.52.3 and gtk+-2.24.31's
 expectations.  This commit fixes the resulting issue in a backwards
 compatible way.

See-Also: https://bugs.gentoo.org/650536
2018-03-18 19:55:37 +01:00
Matthias Clasen
98687be562 Merge branch 'gtk-2-24' into 'gtk-2-24'
gtkprintbackendcups.c: fix \n at end of a debugging note

See merge request GNOME/gtk!23
2018-02-19 17:58:19 +00:00
Jeremy Tan
61162225f7 GDK W32: Ignore autorepeated key presses on modifier keys
The X11 backend does not send autorepeated messages for modifier keys,
and doing so prevents motion compression from working.

https://bugzilla.gnome.org/show_bug.cgi?id=771568
2018-02-17 17:55:22 +00:00
Jeremy Tan
bfdac2f70e GDK W32: Always process all available messages
The GLib main loop blocks on MsgWaitForMultipleObjectsEx to
determine if there are any incoming messages while also allowing
for background tasks to run. If all available messages are not
processed after MsgWaitForMultipleObjectsEx has signaled that
there are available, CPU usage will skyrocket.

From my limited understanding (by inspection of profiling
under Visual Studio):
Key is pressed - MsgWaitForMultipleObjectsEx unblocks, and
sends message to GDK's event handler. Some event is now queued.

g_poll unblocks, calls the g_event_dispatch which finally
resolves to gdk_event_dispatch. This then calls
_gdk_win32_display_queue_events, but since a message is already
queued, it fails to call PeekMessage and returns immediately.

At the next iteration, g_poll again calls MsgWaitForMultipleObjectsEx
which queues yet another event and returns almost immediately, since
there are events available which haven't been processed by PeekMessage.

The dispatch function is then called and the process repeats.

https://bugzilla.gnome.org/show_bug.cgi?id=771568
2018-02-17 17:55:14 +00:00
Ivan Zakharyaschev
7461ceebe3 gtkprintbackendcups.c: fix \n at end of a debugging note 2018-02-17 20:19:33 +03:00
Matthias Clasen
61751e0e37 Merge branch 'gtk-2-24' into 'gtk-2-24'
calendar: Use the new "%OB" format if supported

See merge request GNOME/gtk!9
2018-02-15 03:06:58 +00:00
Rafal Luzynski
2ea743ab46 calendar: Use the new "%OB" format if supported
Due to the recent changes introduced in glibc 2.27 "%OB" is the
correct format to obtain a month name as used in the calendar
header.  The same rule has been working in BSD family (including
OS X) since 1990s.  This simple hack checks whether "%OB" is supported
at runtime and uses it if it is, falls back to the old "%B" otherwise.

Closes: #9
2018-02-13 23:02:28 +01:00
Emmanuele Bassi
f14fbca645 Revert "Fix abicheck"
This reverts commit 331877fe36.

The newly visible symbols were the result of a bug in the Python port of
glib-genmarshal, which was fixed in GLib 2.54.

https://bugzilla.gnome.org/show_bug.cgi?id=793057
2018-02-10 18:55:59 +00:00
Chris Lamb
78c34e11c3 gtk/queryimmodules.c: Make the output deterministic.
Whilst working on the Reproducible Builds effort [0], we noticed that
queryimmodules generates non-reproducible output as it iterates over the
filesystem without sorting.

Patch attached.

 [0] https://reproducible-builds.org/

Signed-off-by: Chris Lamb <lamby@debian.org>

https://bugzilla.gnome.org/show_bug.cgi?id=786528
2018-01-22 19:59:59 +00:00
Ting-Wei Lan
c3ededb119 configure: Move all includes to the first argument of AC_TRY_LINK
Putting includes in the second argument of AC_TRY_LINK is not safe. If
a header having inline functions is included inside the main function,
it becomes a nested function. This is not supported by clang.

https://bugzilla.gnome.org/show_bug.cgi?id=792720
2018-01-20 17:57:01 +08:00
Matthias Clasen
ed7d3e25f8 2.24.32 2.24.32 2018-01-08 16:35:39 -05:00
Matthias Clasen
331877fe36 Fix abicheck
Update symbols files, and ignore marshallers that appear.
2018-01-08 16:35:39 -05:00
Colomban Wendling
61d5c82f5c Fix updating the widget accessible description when using its tooltip
We need to notify ATK the description changed when the tooltip text
associated with the widget changes and gail_widget_get_description()
would use it as the description.

https://bugzilla.gnome.org/show_bug.cgi?id=779009
2017-12-09 21:42:36 -05:00
Chun-wei Fan
5ce6f249d7 Fix introspection builds on Visual Studio 2017
Detect Visual Studio 2017 properly, so that we won't mistaken it for
2015.
2017-12-06 20:44:19 +08:00
Piotr Drąg
a52af4303a Update Polish translation 2017-12-02 18:38:42 +01:00
Daniel Boles
bc555cd64f imcontextxim: Fix showing glyph in status window
This custom drawing code was broken, which meant the current mode
indicator/character did not show, severely hindering XIM users.

Fix by simply removing the custom drawing and just being a GtkWindow, by
cherry-picking these two from GTK+ 3:
  commit 211ccb5c73
  commit c750cea4e57ed3bcb5ba7eada95d0be380aa2fe5t

https://bugzilla.gnome.org/show_bug.cgi?id=696624
2017-10-21 19:08:03 +01:00
Chun-wei Fan
b7e5da4cd4 Visual Studio builds: Improve binary security
Ensure that the /DYNAMICBASE linker option (which is actually the
default option) is enabled, as we inadvertly disabled it in our
projects.

Also, for x64 builds on MSVC 2012 or later, use the /HIGHENTROPYVA
linker option to improve the security of the built bianries.

Pointed out by Ignacio Casal Quinteiro.
2017-10-20 17:11:46 +08:00
Daniel Boles
292e023c83 Fixed: If can’t add child, don’t add to child info
If the call to set_parent() failed, we were still adding the child to
the internal list of children, despite that it was not really added.
That meant we could later try to do invalid stuff with that non-child.

Fix that by asserting and giving up if the child that the user is
attempting to add is already parented.

https://bugzilla.gnome.org/show_bug.cgi?id=701296
2017-10-13 09:56:17 +01:00
Daniel Boles
6b4e050e15 ComboBox: Don’t let modes disconnect each other
…from priv->button. My refactor to g_signal_disconnect_by_data()
included this widget, when I shouldn’t have as both modes use it.
In GTK+ 3, this broke opening a CB by keyboard that was in menu mode,
if it had been in list mode initially (e.g. due to the theme).

Fix by moving to disconnect_by_func() and only removing in each mode’s
destroy() method the signals that it set on the button in its setup().

https://bugzilla.gnome.org/show_bug.cgi?id=788577
2017-10-06 01:43:06 +01:00
Colomban Wendling
687e4576eb Enter submenus when activating their parent item
This gives consistent behavior with e.g. Qt, Mozilla's suites and
LibreOffice (with non-truly native backends like "gen" and "gtk",
but unlike "gtk2" and "gtk3" ones that probably use true GTK menus).

This behavior is expected by at least some accessibility users, and
it seems good to behave like other common applications and toolkits
in this area.  There should be no issue in doing so either for current
users, as it only enters the submenu instead of not doing anything.

https://bugzilla.gnome.org/show_bug.cgi?id=778811
2017-10-05 19:47:14 +01:00
Daniel Boles
c75c8d0bda ComboBox: Don’t pile up ::grab-broken handlers
It was connecting a new handler to do the same thing every time it
popped up, never disconnecting between. Just connect once in init().
2017-10-05 19:47:13 +01:00
Daniel Boles
2678cda50a testcombo: Test grid :row- and :column-span-column
Ditch two items that were white and so weren’t visible on our standard
theme anyway, and use the new space to test extra grid-mode properties.

Note if we do this then, as before, set the ListStore on the CB before
before appending to it, that (at least in GTK+ 3) gave warnings like:

Gtk-CRITICAL **: gtk_menu_attach: assertion 'left_attach < right_attach' failed

I didn’t look into that yet, but it may indicate that attaching items
vs. recognising their spans don’t occur in the correct order. For the
purposes of testing this, I just create the CB after filling its model.
2017-10-05 19:47:13 +01:00
Daniel Boles
a10a2ebf19 testcombo: Fix generation of coloured pixbufs
We need floating-point division… Otherwise, only fully-on inputs can
produce any output. This fixes some of the colours wrongly being black.

While here, remove the unused rowstride variable, to shush a warning.
2017-10-05 19:47:13 +01:00
Matthias Clasen
9480f6649b Add a big combobox test case
I've seen many bugs about long combo box popups getting misplaced
or wrongly sized. Time to add a testcase.
2017-10-05 19:47:13 +01:00
Daniel Boles
e46ac4dcba ComboBox: Clarify :row|column-span/wrap-width docs
ComboBox warned in the doc for :row-span-column that the value must not
exceed :wrap-width, but :wrap-width does not interact with the number of
rows; it’s the :column-span-column that’s relevant.

Also: Warn that spans must be > 0 for rows too, & that column spans <=
:wrap-width are also not useful for items at menu column positions > 0.
Rrefer to items having spans, not values, as we’re already talking about
values in the model (& rows in the menu). And clarify :wrap-width a bit.
2017-10-05 19:47:13 +01:00
Daniel Boles
111853d7da Entry: Fix leak of text in ensure_has_tooltip()
Thanks to Mohammed Sadiq for noticing this. I guess I got
Widget.get_tooltip_text() confused with Label.get_label().

https://bugzilla.gnome.org/show_bug.cgi?id=787410
2017-09-07 14:59:15 +01:00
Daniel Boles
b51eea1881 Revert "ComboBox: Don’t redundantly show() scrolled_window"
This reverts commit 03ead0c824.

That was a real brainfart, which broke showing list-mode CBs on the 2nd
and subsequent popups.
2017-09-05 00:14:00 +01:00
Ingo Brückl
c12dd8f0b9 Set translation domain for parameter_string in gtk_init_with_args
This was requested in bug 554926.

Backport of original commit e3bd926c1e by
Gabor Kelemen, kelemeng at gnome dot hu, applied to GTK+ 2.90.5 on Tue,
10 Aug 2010 04:13:22 +0000 (UTC).

https://bugzilla.gnome.org/show_bug.cgi?id=785165
2017-09-03 14:44:45 +01:00
Daniel Boles
d57d105e11 Toolbar: Clarify how the arrow overflow menu works
The fact it affects the preferred size, and only works with ToolItems
that return a menu proxy item, was unclear unless deduced from other
sources, and this led to users thinking it was broken, for example:

https://stackoverflow.com/q/44644642/2757035

https://bugzilla.gnome.org/show_bug.cgi?id=787158
https://bugzilla.gnome.org/show_bug.cgi?id=787195
2017-09-03 11:22:58 +01:00
Daniel Boles
86d80b9d76 ToolItem: Add see-also from proxy setter to signal 2017-09-03 11:21:40 +01:00