Commit Graph

1124 Commits

Author SHA1 Message Date
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
Matthias Clasen
2e04817701 xim: Stop using ::configure-event
The generic ::event will do.
2018-01-16 14:14:10 -05:00
Matthias Clasen
845f2657db cups: Warn only once if colord is not available
No need to keep complaining about this.

https://bugzilla.gnome.org/show_bug.cgi?id=791650
2017-12-17 17:09:55 -05:00
Matthias Clasen
072f06abf7 Fix fallout from g_object_ref change
g_object_ref now returns the type of the object that was
passed. Introduce cast as necessary to avoid warnings due
to this.
2017-12-08 17:48:47 -05:00
Chun-wei Fan
824837486b gtkimcontextime.c: Fix call to gtk_style_context_get()
The state argument was removed in commit 1518fe0 (API: stylecontext:
Remove state argument from getters), but we missed updating this file
until commit 5b94fe6 (stylecontext: Make first property name explicit),
as the compiler did not issue any warnings on the (now-defunct) usage.

https://bugzilla.gnome.org/show_bug.cgi?id=773299
2017-11-21 14:16:06 +08:00
Matthias Clasen
9d9674a7ca im context thai: Stop using gdk_beep
It is about to go away.
2017-11-16 22:09:44 -05:00
Matthias Clasen
2d6bd1ae6d Drop gdk_window_get_screen
This includes removing the GdkScreen argument from the
create_window_impl display vfunc.
2017-10-31 17:25:01 -04:00
Benjamin Otte
07164e098a window: Turn gtk_window_set_screen() into gtk_window_set_display()
And have a priv->display instead of a priv->screen.

Includes turning gtk_menu_set_screen() into gtk_menu_set_display(),
because that function just forwards to its window.
2017-10-31 08:25:37 +01:00
Chun-wei Fan
64a489adbf input/IME: Defer the emit of the "commit" signal
On Windows, when IME is used, each keystroke results in the
WM_IME_COMPOSITION event being sent first.  This means that in our case
when one decides on to accept the input that is in the preedit buffer,
we first get from Windows the WM_IME_COMPOSITION event
(where we emit the commit signal), followed by the WM_IME_ENDCOMPOSITION
event (where we emit the pair of preedit-changed and preedit-end
signals).

Since commit f11f989 (GtkEntry: Remove recompute idle), we do the input
recomputation directly, this will cause a pair of "Pango-WARNING:
Assertion failed: (index >= 0 && index <= layout->length)" being shown,
as gtkentry.c's priv->preedit_length and priv->preedit_cursor was unable
to be reset to 0 in time as a result of the recomputation triggered by
the commit being done before the reset of priv->preedit_length and
priv->preedit_cursor (which are no longer valid as we essentially say
that we are done with the preedit buffer).

As we could only acquire the final string that was entered in this
preedit session when we handle the WM_IME_COMPOSITION event, fix this by
saving up the final string we acquire from Windows IME in UTF-8 when we
handle the WM_IME_COMPOSITION event from Windows, and emit the commit
signal with that string after we emit the preedit-changed and
preedit-end signals when we handle the WM_IME_ENDCOMPOSITION event from
Windows, which comes afterwards.

Also fix the formatting of the code around the parts of the files that
was changed.

https://bugzilla.gnome.org/show_bug.cgi?id=787142
2017-10-30 14:33:06 +08:00
Marek Kasik
fda120ceec printing: Install printbackends
Add "install : true" for each printbackend so that they are installed.

https://bugzilla.gnome.org/show_bug.cgi?id=789185
2017-10-26 09:49:13 +02:00
Chun-wei Fan
a65730f38f modules/input/gtkimcontextime.c: Fix build
The GdkEvent structure became opaque, so we need to update the code so
that we use the getters and setters here.

https://bugzilla.gnome.org/show_bug?id=773299
2017-10-25 00:46:11 +08:00
Marek Kasik
3d233743ec printing: Don't show duplicate printers
Check UUID for printers obtained via DNSSD whether
they are already installed on local CUPS server.
Don't show such printers.

Not all printers published via DNSSD have UUID entry though.

https://bugzilla.gnome.org/show_bug.cgi?id=786794
2017-10-09 17:54:50 +02:00
Matthias Clasen
974b99694d xim: Convert to GdkEvent API 2017-09-19 18:39:02 +02:00
Carlos Garnacho
668bb1bddd modules: Update input context impls to using GdkEvent API 2017-09-19 18:39:02 +02:00
Emmanuele Bassi
391d1a04ec Drop Autotools build
We are officially switching to Meson as the default build system for
GTK+.
2017-08-14 22:23:09 +01:00
Matthias Clasen
916702f7a9 Make the xim module build without root getters
This is X specific code anyway, so no need to use
generic GDK api for this.
2017-08-11 15:45:24 -04:00
John Ralls
a2c4c54a2f Duplicate the TIC strings before NULLing the GObject data.
NULLing the data strings in GObject frees and invalidates the pointers
returned by g_object_get_data so we need our own copy of the values.
2017-08-08 23:21:55 +03:00
John Ralls
a72c735b74 Fix compile error in imquartz.c due to API change in GtkIMContext. 2017-07-18 18:44:21 -07:00
Chun-wei Fan
ac5f7d028f modules/input/gtkimcontextime.c: Move to set_client_widget
The imcontext internals have been changed to use set_client_widget
instead of set_client_window in order to remove API dependency on
GdkWindow.  Update the Windows IME support so that the code will
continue to build and work.

https://bugzilla.gnome.org/show_bug.cgi?id=773299
2017-06-06 00:17:40 +08:00
Carlos Garnacho
d39afa6011 imcontext: Remove API dependency on GdkWindow
There is now a set_client_widget() to hint the IM about positioning
and whatnot.
2017-05-25 16:25:58 +02:00
Tim-Philipp Müller
88900814cd meson: simplify cups version check in printbackends
Using cc.compute_int() instead of cc.get_define() for now
as there seems to be some issue with get_define() (#1726).
2017-05-03 18:40:56 +01:00
Emmanuele Bassi
91dee46497 build: Use get_pkgconfig_variable()
There's no need to run pkg-config ourselves.
2017-05-03 15:10:57 +01:00
Emmanuele Bassi
17518ef89b build: Improve consistency of the "coding" style
We're mixing a lot of styles in the Meson build files. This is an
attempt at making everything slightly more consistent in terms of
whitespace and indentation.
2017-05-03 15:10:57 +01:00
Emmanuele Bassi
1afd415583 build: Clean up print backends Meson rules 2017-05-03 15:10:57 +01:00
Emmanuele Bassi
81341c042b build: Disable deprecation warnings for input methods 2017-05-03 15:10:57 +01:00
Tim-Philipp Müller
e850973956 meson: build input modules
We have to work around some ordering problems here. We still
manage to keep most of the guts in modules/input/meson.build,
so it's not too ugly overall.

(The autotools build solves this with a 'make -C ../../input/modules'
inside gtk/Makefile, but that's not something we can or want to do.)
2017-05-03 15:10:56 +01:00
Tim-Philipp Müller
412c2225b1 meson: move colord checks into cups printbackend
Which is the only user of it. Also add option to enable/disable.
2017-05-03 15:10:55 +01:00
Tim-Philipp Müller
d38db4dcdd meson: gtk: set GTK_PRINT_BACKENDS define properly 2017-05-03 15:10:55 +01:00
Tim-Philipp Müller
a35e5f3135 meson: modules: add printbackends
The cups checks might not work properly everywhere yet,
since they don't use cups-config and parse the output yet.
2017-05-03 15:10:55 +01:00
Emmanuele Bassi
71ad17cae1 Remove gdkkeysyms-compat.h
The compatibility header was needed after GTK+ 3.0 renamed the key
symbols from `GDK_*` to `GDK_KEY_*` to avoid collisions.
2017-05-03 14:54:37 +01:00
Matthias Clasen
41389ca98c Avoid some compiler warnings 2017-03-23 15:15:12 +00:00
Piotr Drąg
bfaed659f1 Fix translator comments
They need to be exactly one line above a string to show up in .po files.
2017-01-28 01:13:12 +01:00
Piotr Drąg
1b6015f9cc gtkprintbackendfile: Correct PostScript capitalization
https://bugzilla.gnome.org/show_bug.cgi?id=776627
2017-01-02 16:20:29 +01:00
Benjamin Otte
9120bdd9e9 xim: Use the native parent window for the X connection
Don't try to gdk_window_get_xid() on the current window.
2016-12-09 18:35:51 +01:00
Carlos Garcia Campos
c836be0508 printing: Do not truncate job names in GtkPrintOperation
We are currently truncating job names to 255 bytes, because that's the
maximum allowed length of job-name attribute in CUPS. This is a CUPS
limitation that GtkPrintOperation shouldn't need to know, and it
shouldn't affect other backends, that might have other limitations or
even no limitation at all. This has another side effect, that what you
set as GtkPrintOperation:job-name could be different to what you get if
the property is truncated, this is not documented in
gtk_print_operation_set_job_name(). So, I think the job name should be
truncated by the CUPS backend, right before setting the job-name
attribute.

https://bugzilla.gnome.org/show_bug.cgi?id=774097
2016-11-10 16:57:30 +01:00
Matthias Clasen
e4e6cb87b2 Rename gtk-query-immodules to follow our binary naming scheme
Instead of gtk-query-immodules-4.0, lets call it gtk4-query-immodules,
to use the same prefix as all the other versioned binaries.
2016-10-18 09:59:42 -04:00
Benjamin Otte
0be88cc76e API: Remove gdk_screen_get_width() and gdk_screen_get_height()
... and gdk_screen_get_width_mm() and gdk_screen_get_height_mm() and
the shortcut counterparts that call these functions on the default
screen.

Modern display servers don't provide an ability to query the size of a
screen or display so we shouldn't allow that either.
2016-10-16 18:17:21 +02:00
Matthias Clasen
d053d5c58f Rename Makefile references from 3.0 to 4.0
This is almost certainly incomplete.
Needs careful scrutiny
2016-10-07 10:34:50 -04:00
Javier Jardón
101da71ee3 Use upstream gettext
https://bugzilla.gnome.org/show_bug.cgi?id=373745
2016-05-16 20:46:19 +01:00
Matthias Clasen
d1b07bc386 Add a comment to explain numbers here
This explains the change in the previous commit.
2016-04-19 07:34:44 -04:00
Piotr Drąg
3fe08b3b28 cups: Fix duplicate string
https://bugzilla.gnome.org/show_bug.cgi?id=765122
2016-04-19 07:25:17 -04:00
Bastien Nocera
97d27ca2f8 cups: Fix gettext usage
The previous patches didn't mark some strings as to be translated, and
tried to translate strings with a variable part already inside the
string, which isn't going to work.

Mark the strings as translatable with context, and also make sure to
translate static strings when getting them out of their structure.

https://bugzilla.gnome.org/show_bug.cgi?id=764585
2016-04-16 18:43:12 +02:00
Felipe Borges
b0b1bf2f58 cups: make string non-literals translatable again
Notice that C_ just takes string literals as arguments.

https://bugzilla.gnome.org/show_bug.cgi?id=764585
2016-04-14 18:55:21 +02:00
Felipe Borges
027702e453 cups: Fix more "format not a string literal" error
https://bugzilla.gnome.org/show_bug.cgi?id=764585
2016-04-13 14:17:24 +02:00
Bastien Nocera
93363551d7 cups: Fix "format not a string literal" error
https://bugzilla.gnome.org/show_bug.cgi?id=764585
2016-04-05 12:58:58 +02:00
Matthias Clasen
a64dd9ccf3 printing: Add message contexts
Some of the translated strings in the cups printbackend are short
and generic and might occur in other contexts. Give them disambiguating
message contexts to avoid translation problems.
2016-02-16 18:32:43 -05:00
Chun-wei Fan
d07f00d98f CJK Windows: Silence gtk_style_context_set_state() warnings
We need to update calls to gtk_style_context_set_state() in
gtkimcontextime.c, so that the state passed into that function would be in
line with what GtkStyleContext expects, due to updates in the CSS
machinery, as outlined in this link[1], which is based on information in
in Matthias' blog[2].

Doing so will silence the gtk_style_context_set_state() warnings, which is
emitted when a widget uses gtkimcontext on Windows with CJK IME, which will
in turn call gtkimcontextime.

[1]: http://feaneron.com/2016/01/04/quick-guide-to-port-an-app-for-gtk-3-20/
[2]: https://blogs.gnome.org/mclasen/2015/11/20/a-gtk-update/

https://bugzilla.gnome.org/show_bug.cgi?id=760314
2016-01-08 23:37:31 +08:00
Felipe Borges
98080e0289 printing: always propagate Collate value
https://bugzilla.gnome.org/show_bug.cgi?id=728344
2016-01-06 14:50:49 +01:00
John Ralls
571704824f Bug 753992 - im-quartz discard_preedit segmentation fault
Replace checking if the NSView is really a GdkWindow, which will crash
in the likely event it's not a GObject, with ensuring that the parent
GdkWindow is really a GdkWindowQuartz.
2015-10-03 22:28:36 -04:00