Commit Graph

21781 Commits

Author SHA1 Message Date
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
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
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
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
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
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
ed7d3e25f8 2.24.32 2018-01-08 16:35:39 -05:00
331877fe36 Fix abicheck
Update symbols files, and ignore marshallers that appear.
2018-01-08 16:35:39 -05:00
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
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
a52af4303a Update Polish translation 2017-12-02 18:38:42 +01:00
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 211ccb5c73a444683d493588c3eb29b457a5586b
  commit c750cea4e57ed3bcb5ba7eada95d0be380aa2fe5t

https://bugzilla.gnome.org/show_bug.cgi?id=696624
2017-10-21 19:08:03 +01:00
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
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
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
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
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
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
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
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
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
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
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
c12dd8f0b9 Set translation domain for parameter_string in gtk_init_with_args
This was requested in bug 554926.

Backport of original commit e3bd926c1ef83027c756488ba19f4353930fc6db 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
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
86d80b9d76 ToolItem: Add see-also from proxy setter to signal 2017-09-03 11:21:40 +01:00
e0e2107f35 ComboBox: Add missing disconnect in menu_destroy()
We were not disconnecting the signals from the menu (popup_widget), so
they were leaked when e.g. the mode was changed or the CB was destroyed.
2017-09-01 16:34:14 +01:00
68e2f276f2 FileChooserDefault: Fix misleading indentation
which caused a compiler warning. Update to match 3.22’s indentation.
2017-09-01 15:12:15 +01:00
e8f15a8d23 FileChooserDefault: Remove an unused #include 2017-09-01 14:23:22 +01:00
104123df8c Update Indonesian translation 2017-08-29 10:18:25 +00:00
03ead0c824 ComboBox: Don’t redundantly show() scrolled_window
It and its child were already show()n in list_setup().
2017-08-28 19:59:39 +01:00
fac72327f9 ComboBox: Fix wrongly matched signal disconnect()s
Various disconnections had the wrong flags and/or data, so we failed to
disconnect a pile of signals, shown by 0 returned by the disconnect_*()
functions. Fix this, and use the nicer disconnect_by_*() while here.
2017-08-28 19:59:39 +01:00
2759e89611 ComboBox: Really set list-mode popup transient-for
set_transient_for(toplevel) was only called in list_setup(). It was easy
to make a test showing a NULL :transient-for instead of the correct one.

So, move the call from list_setup() to real_popup(). Also do the same
for window_group_add_window(), which means not calling it redundantly.

(I tried using a ComboBox:parent-set handler, but the Inspector’s CB
didn’t like that: it calls popup_for_device() twice and closes on button
release. Anyway, using popup() is much more concise than a new handler.)
2017-08-28 19:59:27 +01:00
faa69b3547 ComboBox: List-mode popup must open on CB’s screen
The screen for the list-mode popup_window was only being set in
set_popup_widget(), i.e. when changing modes, so if the ComboBox was
moved to a different screen later, the popup would appear on the
original one, which is wrong.

Worse, this broke opening some combos in the Inspector in GTK+ 3.

Fix this by moving the call to set_screen() to real_popup(), so
the popup_window is put on the correct screen each time around.

https://bugzilla.gnome.org/show_bug.cgi?id=468868
https://bugzilla.gnome.org/show_bug.cgi?id=786771
2017-08-28 19:02:59 +01:00
1297710879 Update Indonesian translation 2017-08-28 15:20:56 +00:00
47bea2deaa ComboBox: Use iter before popdown() may invalidate
Bad actors, such as our very own FileChooserButton, may connect to the
:popped-up property and alter the model as the menu becomes in/visible.

We were getting an iter to the model while popped-up, then doing
popdown(), then using the iter, which may have just been invalidated by
the errant notify::popped-up handler. If so, we quickly crash fatally.

This is clearly bonkers, but until such patterns are removed, we have to
work around them. So, set_active() from the clicked item while it is
known to be valid, by moving the call to set_active() before popdown().

While here, change set_active_iter(iter) to set_active_internal(path) to
avoid pointlessly going through the iter to get the path we already have

https://bugzilla.gnome.org/show_bug.cgi?id=729651
2017-08-25 21:03:33 +01:00
2166e25f2e ComboBox: Clarify documentation of get_active_iter
https://bugzilla.gnome.org/show_bug.cgi?id=618160
2017-08-25 20:59:50 +01:00
bf8c1c212e Container: Don’t scroll to unset focus child coord
In gtk_container_real_set_focus_child(), we try to scroll to the
position of the new :focus-child if we have h or v adjustments.

gtk_widget_translate_coordinates() returns FALSE if neither widget is
realized or in other situations that cause output parameters x and y not
to be set. Thus, if the caller did not initialise x/y and uses them even
if the function returns FALSE, they are using uninitialised variables.

In gtk_container_real_set_focus_child(), we did not check the return
value but merrily went ahead and used x and y regardless. This is UB, as
caught by Valgrind, as well as being pointless.

The trivial fix is to exit early if (!gtk_widget_translate_coordinates).

https://bugzilla.gnome.org/show_bug.cgi?id=776909
2017-08-07 19:20:51 +01:00
e6d2655e1e GtkLabel: make patterns work a little better
When a pattern has been set, we must not throw away
the attributes that contain it.

https://bugzilla.gnome.org/show_bug.cgi?id=658111
https://bugzilla.gnome.org/show_bug.cgi?id=676550
2017-08-06 19:07:24 +01:00
491d79d540 recentchooserdefault: Clean up load_id when we have nothing left to do
Returning FALSE from a GSourceFunc will implicitly remove it, so we need
to do this in order to make the new g_source_remove happy.

https://bugzilla.gnome.org/show_bug.cgi?id=779605
2017-08-05 19:23:06 +01:00
277c8286a1 GtkFixed: Update documentation intro
• Add GtkLayout as a @See_also since it includes fixed-pos functionality
• Explain how to work around the problems with RTL text
2017-08-03 13:15:04 +01:00
bb3b34af30 Layout: Add GtkFixed to docs as a See_Also 2017-08-03 13:15:04 +01:00
fdb701837f 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:13:00 +01:00
8302b71381 Entry: Warn about corner case hiding icon tooltips
https://bugzilla.gnome.org/show_bug.cgi?id=785672#c4
2017-08-01 18:12:59 +01:00
28cc9735de Entry: Fix a misspelt method name in a doc comment 2017-08-01 18:12:52 +01:00
ca2e62da22 build/win32/replace.py: Fix replacing items in files with UTF-8 content
Some files that this script will process might have UTF-8 items in
there, which can cause problems on Python 3.x as it is more strict and
careful on unicode issues.

Fix this by:
-Doing what we did before on Python 2.x
-Opening the file with encoding='utf-8' on Python 3.x
2017-05-09 18:37:58 -07:00
268e3ecc09 Update Hungarian translation 2017-05-05 18:49:47 +00:00
94929bc0e0 Scale: Explain how to round value when !draw-value
Scale:digits is (now, again) ineffective if Scale:draw-value is FALSE.
To get rounding in that case, the base Range:round-digits must be used.
2017-05-02 12:36:05 +01:00
9ecbf966a4 Update Polish translation 2017-04-30 19:52:43 +02:00
aac544b742 Scale: Fix documentation of digits per last revert
Add a clarifying note that, under the original behaviour, :digits only
rounds the Adjustment if :draw-value is TRUE at the time of the change.

This is based on a similar commit made by Daniel Boles for the gtk3
branches like 1cd0a8de0b70

https://bugzilla.gnome.org/show_bug.cgi?id=781605
https://bugzilla.gnome.org/show_bug.cgi?id=358970
2017-04-30 19:32:03 +02:00