Commit Graph

16999 Commits

Author SHA1 Message Date
Руслан Ижбулатов
1d4e36a04b W32 - don't use gettext & gcov during gettext init
Non-representable characters during UTF16->locale conversion
will cause gcov code to return an error, for which it will try
to use gettext, so that the error message is localized.

If such call is made while gettext is being initialized
(there's a g_once_init_enter up the stack), the thread will hang forever.

To solve this, use W32 API to do the UTF16->locale conversion
and don't use gettext when it returns an error.

Also optimize g_win32_locale_filename_from_utf8() a bit,
as we need more UTF16 and less UTF8 now.

https://bugzilla.gnome.org/show_bug.cgi?id=784579
2017-07-13 10:24:00 +00:00
Aleksandr Slobodeniuk
8430939b5e docs: fixing lost character
https://bugzilla.gnome.org/show_bug.cgi?id=784792
2017-07-11 14:23:08 +01:00
Daniel Boles
e6acb07426 docs: tut_gsignal: Fix mismatched argument names
The names differed between the argument declaration and its description.
2017-07-11 12:53:33 +01:00
Matthias Clasen
d0f51e8d10 gsettings: Try harder to describe keys
If a key has no description, show the summary,
rather than "(null)". Since thats not helpful at all.
2017-07-10 08:58:55 -04:00
Matthias Clasen
72f5d59c3f Avoid a race with the openuri portal
Same as the previous commit; use the new predictable request
object path to connect to the Response signal early.
2017-07-07 12:18:12 -04:00
Matthias Clasen
2f4d79a6da Disambiguate source names
This makes debugging more pleasant.
2017-06-28 15:49:40 -04:00
Matthias Clasen
90bb8778f2 2.52.3 2.52.3 2017-06-22 09:15:23 -04:00
Matthias Clasen
373fda6809 appinfo: Fix the build on windows
The previous commit forgot to protect some unix-only
calls by an ifdef.

Pointed out by John Emmas.
2017-06-22 08:55:45 -04:00
Matthias Clasen
098f9c6088 OpenFile support: Handle open failing
This can happen, report it as an error when it does.
2017-06-22 08:55:34 -04:00
Matthias Clasen
7cb7967cf5 Use OpenFile for local files
The OpenURI portal has a separate method to handle local
files now. Use it.

At the same time, split out the openuri helpers into separate
files, and generate code for the OpenURI portal.

https://bugzilla.gnome.org/show_bug.cgi?id=783193
2017-06-22 08:55:26 -04:00
Florian Müllner
2026cb7498 gdbus-codegen: Apply --output-directory to generated docs as well
In addition to code, gdbus-codegen can also generate docbook
documentation for DBus interfaces. There's no good reason why
the newly added --output-directory option shouldn't apply to
those generated files as well.

https://bugzilla.gnome.org/show_bug.cgi?id=783201
2017-06-22 08:53:50 -04:00
Matthias Clasen
169c7f1d57 Make dbus activation sandbox-aware
When we call org.freedesktop.Application.Open to activate
an application and pass file uris, the application may not
be able to see the files due to a flatpak sandbox.

Flatpak puts the flatpak app-id in the  X-Flatpak key in
desktop files that it exports, so we can easily recognize
applications that may be affected by this.

In this case, call the document portal to export the files
and pass the resulting uri's instead of the original ones.

https://bugzilla.gnome.org/show_bug.cgi?id=783130
2017-06-22 08:53:44 -04:00
Matthias Clasen
05cc4048bb Add a wrapper for the AddFull document portal api
This is a wrapper which takes a list of uris and rewrites
them by calling AddFull with the file:// uris.

https://bugzilla.gnome.org/show_bug.cgi?id=783130
2017-06-22 08:53:36 -04:00
Matthias Clasen
ba984abddc Update flatpak document portal interface
This api has been changed upstream, recently.

A new AddFull method has been added in this commit:
6ce8521b64

https://bugzilla.gnome.org/show_bug.cgi?id=783130
2017-06-22 08:53:30 -04:00
Chun-wei Fan
87c928f39c Visual Studio builds: Visual Studio 2013 and later has va_copy()
Update config.h.win32.in and glib/glibconfig.h.win32.in to indicate so.
2017-06-14 11:50:04 +08:00
Руслан Ижбулатов
3245eba169 GetTickCount64 is a __stdcall function
https://bugzilla.gnome.org/show_bug.cgi?id=781301
2017-06-01 11:07:19 +00:00
John Lindgren
8e517df7d4 NtNotifyChangeMultipleKeys is a __stdcall function.
https://bugzilla.gnome.org/show_bug.cgi?id=781301
2017-06-01 11:07:19 +00:00
Chun-wei Fan
958902ed9a Visual Studio builds: Redo utility script generation
Use the new gen_util_scripts.py script to generate the glib-mkenums and
gdbus-codegen scripts with the proper info in them so that they can be
used properly by other build systems such as Meson, during "install".
2017-05-24 15:47:36 +08:00
Chun-wei Fan
b095df4565 Visual Studio builds: Add script to generate utility scripts
This will allow the utility scripts glib-mkenums and gdbus-codegen be
generated with the proper info in them, as build systems such as Meson
might look for shebang lines to determine the commands that need to be
called to invoke the scripts (which is necessary for calling these
scripts on standard Windows cmd.exe)
2017-05-24 13:22:58 +08:00
Ignacio Casal Quinteiro
bae70d7482 Revert "GSocket: Fix race conditions on Win32 if multiple threads are waiting on conditions for the same socket"
This reverts commit 799f8dcd46.
This patch seems to break applications that use GTask specific
operations with GSocket. We will need to investigate a bit more
on this issue but for now we revert it and leave it for the
next major release.
2017-05-11 18:01:39 +02:00
Philip Withnall
c589084003 gmain: Allow GSource methods to be called from a finalize() callback
Temporarily increase the ref count of a GSource to 1 while calling its
finalize() callback, so that the finalize() implementation can call
GSource methods (like g_source_set_ready_time()) without causing
critical warnings. It’s safe to call those methods at this point, as the
source has been destroyed, but nothing has been freed.

This is an indirect way of fixing a race between GCancellable and
GCancellableSource, whereby the GCancellable::cancelled callback for the
GCancellableSource is not disconnected until the GCancellableSource’s
finalize() function is called. Previously, this meant there was a window
in which the GCancellableSource’s ref count was 0, but the ::cancelled
callback was still connected, and could legitimately be called as a
result of another thread calling g_cancellable_cancel() on the
GCancellable. The callback calls g_source_set_ready_time() on the
GSource, and there’s no thread-safe way of checking whether the GSource
has been destroyed. Instead, we have to change GSource so its ref count
is only decremented to 0 inside the locked section in
g_source_unref_internal() *after* the finalize() function has been
called, and hence after the GCancellable::cancelled callback has been
disconnected. The use of g_cancellable_disconnect() ensures that the
callback disconnection is thread safe.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=781601
2017-05-11 08:56:45 +01:00
Paolo Bonzini
5d74233476 gmain: only signal GWakeup right before or during a blocking poll
Since commit e4ee307 ("Do not wake up main loop if change is from same
thread", bug 761102), GMainContext uses context->owner to decide if the
event loop is being run in the current thread.  However, what really
matters is the phase in the prepare/query/poll/check/dispatch sequence.
Wakeups are only needed between the end of prepare and the end of poll,
and then only if prepare found that no sources were ready.

There is no need to take threads into account, because prepare, check
and all callers of conditional_wakeup all look at the new need_wakeup
flag inside LOCK_CONTEXT/UNLOCK_CONTEXT.

With this change, g_main_context_is_owner and g_main_context_wait are
the only functions for which acquire/release matters, just like before
commit e4ee307.

Signed-off-by: Paolo Bonzini <bonzini@gnu.org>
2017-05-11 08:55:37 +01:00
Chun-wei Fan
21be268a30 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
-Open the file with encoding='utf-8' on Python 3.x
2017-05-09 18:21:45 -07:00
Ondrej Holy
b8bd46bc86 gunixmounts: Prevent unwanted automount requests
mnt_table_is_fs_mounted causes unwanted automount requests due to
canonicalization of source and target. It might be replaced by
mnt_table_find_source as per the documentation in order to prevent
the automounts, but it is redundant. All mtab entries should be already
mounted and thus mnt_table_is_fs_mounted result is always true (it
basically checks that the fs from mtab is in mtab). Let's remove
the check at all.

https://bugzilla.gnome.org/show_bug.cgi?id=781867
2017-05-09 14:34:30 +02:00
Matthias Clasen
bbe2286be3 2.52.2 2.52.2 2017-05-08 11:28:22 -04:00
Matthias Clasen
3a6811a460 portal support: Raise the priority for network monitor
When we are inside a sandbox, we want to use the portal
implementation, since it is the only one that has a chance
of working.

This is safe to do, since the portal implementation will
just fail initialization when loaded outside a sandbox.
2017-05-02 07:29:25 -04:00
Daniel Macks
ab333f42b6 Implement g_content_type_is_mime_type() (clone of win32's)
Add missing function, copying from gcontenttype-win32.c per Patrick
Griffis (Comment #55 of bug report)

https://bugzilla.gnome.org/show_bug.cgi?id=734946
2017-04-28 06:42:12 -04:00
Rafal Luzynski
bd555b9ba0 gosxappinfo: fix typo in g_osx_app_info_launch_internal
Correct error domain is G_IO_ERROR.

https://bugzilla.gnome.org/show_bug.cgi?id=734946
2017-04-28 06:42:02 -04:00
Patrick Griffis
917f3068c3 gosxappinfo: Special case x-scheme-handler
This is the only way they are exposed on Unix so we need to handle it

https://bugzilla.gnome.org/show_bug.cgi?id=734946
2017-04-28 06:41:50 -04:00
Patrick Griffis
eb0fbe633c gosxappinfo: Fix get_default_for_type() on 10.10+
https://bugzilla.gnome.org/show_bug.cgi?id=734946
2017-04-28 06:41:29 -04:00
Patrick Griffis
d99af84a36 build: Don't build dbus-appinfo on OSX
https://bugzilla.gnome.org/show_bug.cgi?id=780309
2017-04-27 21:53:56 -04:00
Patrick Griffis
4246b1ef8c gosxappinfo: Fix typo in ifdef
https://bugzilla.gnome.org/show_bug.cgi?id=780300
2017-04-27 21:53:39 -04:00
John Lindgren
2eddcef1e7 Do not mix declarations with code.
https://bugzilla.gnome.org/show_bug.cgi?id=781298
2017-04-18 14:30:13 +08:00
Kukuh Syafaat
bed861bcf8 Update Indonesian translation 2017-04-16 03:36:18 +00:00
Paolo Bonzini
2b47c8360c gmain: Signal wakeups if context has never been acquired as well
Should address backwards compatibility with how qemu is using
`GMainContext`.

See https://bugzilla.gnome.org/show_bug.cgi?id=761102#c14

Input-into-keyboard-by: Colin Walters <walters@verbum.org>
2017-04-11 11:56:11 -04:00
Colin Walters
1d38e6cf6f main: Create a helper function for "owner wakeup" optimization
The original patch really should have introduced a helper - among
other things it deserves a code comment.  We're likely to make
further changes too, so it's obviously better to only do it in one
place.

See: https://bugzilla.gnome.org/show_bug.cgi?id=761102
2017-04-11 11:56:07 -04:00
Matthias Clasen
8ef5eae694 2.52.1 2.52.1 2017-04-08 01:55:00 -04:00
Philip Withnall
35060eb9ae gfileutils: Add precondition checks to g_file_test()
Otherwise g_file_test(NULL, …) causes a call to access(NULL, …) on
Linux, which is disallowed and valgrind complains about it.

https://bugzilla.gnome.org/show_bug.cgi?id=755046
2017-04-08 01:47:34 -04:00
Ole André Vadla Ravnås
632a224cab gdbus: fix false positive g_warning() in remove_filter()
The GDBus thread might be holding a ref while requesting to remove the
filter.

https://bugzilla.gnome.org/show_bug.cgi?id=779409
2017-04-08 01:47:23 -04:00
Adrian Perez de Castro
4d1d5b4544 Better documentation for g_app_info_equal()
Explicitly state that the function may not compare the contents of the
passed GAppInfo instances.

This fixes bug #777961.
2017-04-08 01:47:11 -04:00
Alexandros Frantzis
13b67ea290 gdbus: Fix memory leak in gdbusmethodinvocation.c
https://bugzilla.gnome.org/show_bug.cgi?id=780924
2017-04-08 01:46:55 -04:00
Philip Withnall
6d56878b75 gvariant: Minor documentation tweak for g_variant_get_fixed_array()
Add a missing clausal comma, and add some backtick formatting.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-04-08 01:46:44 -04:00
Debarshi Ray
c3f555b69e docs: Clarify the use of the GError in g_tls_database_verify_chain*
Being able to determine that a certificate chain is invalid is not
considered an error, but success. This might not be obvious at first
due to the way the method is named and described currently. Since we
cannot change the name, let's improve the description and clarify this
aspect of its behaviour.

https://bugzilla.gnome.org/show_bug.cgi?id=780310
2017-04-08 01:46:34 -04:00
Philip Withnall
f7ca0a197e gio: Handle NULL cached properties in NetworkManager monitor
g_dbus_proxy_get_cached_property() and
g_dbus_proxy_get_cached_property_names() can both return NULL if the
property cache is empty. Avoid a crash if this situation arises (which
it looks like it could, from reading the code) by gracefully bailing out
on NULL return values.

Coverity issues: #1257044, #1257045

https://bugzilla.gnome.org/show_bug.cgi?id=741229
2017-04-08 01:46:12 -04:00
Philip Withnall
20fcc2d1cb gsocket: Fix potential multiplication overflow calculating timeout
socket->priv->timeout is only a guint, and the multiplication is
performed before it’s widened to gint64 to be stored in start_time
(thanks, C). This means any timeout of 50 days or more would overflow.
Fixing this bug makes me feel a real sense of self-worth.

Coverity ID: 1159478

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-04-08 01:46:05 -04:00
Philip Withnall
b010caeca8 build: Include gettext libraries for static compilation on Mac OS X
When compiling statically against the system-provided gettext on Mac OS
X, GLib needs to be linked against CoreFramework, which provides some
functions used by gettext.

Fix this by including the necessary macro magic from upstream gettext.

https://bugzilla.gnome.org/show_bug.cgi?id=725894
2017-04-08 01:45:37 -04:00
Colin Walters
2a38996618 gdbusprivate: Include a few headers to fix win32 build
Followup to previous commit.

See: https://bugzilla.gnome.org/show_bug.cgi?id=674885
2017-04-08 01:44:27 -04:00
Colin Walters
4367515d06 gdbus: Initialize types earlier to break proxy <-> connection deadlock
This will help us break generic GType deadlocks between people using
GDBus in different threads (which is supported), not just by GType
usage in the GDBus thread.

This should fix the common cases we're seeing in the wild, although I
have some lingering concerns that if someone e.g. referenced
e.g. `G_TYPE_DBUS_AUTH_MECHANISM_SHA1` etc. we'd need to add those
too.

https://bugzilla.gnome.org/show_bug.cgi?id=674885
2017-04-08 01:44:19 -04:00
INSUN PYO
7725280cbf gdbus: Initialize types at async entrypoints
This isn't a comprehensive fix, but should cover a lot of cases
for GDBus.

https://bugzilla.gnome.org/show_bug.cgi?id=674885
2017-04-08 01:44:12 -04:00
Patrick Griffis
2f2100433f gosxcontenttype: Fix various tests
https://bugzilla.gnome.org/show_bug.cgi?id=780384
2017-04-08 01:44:06 -04:00