Merge lp:~attente/indicator-keyboard/fcitx-transition into lp:indicator-keyboard

Proposed by William Hua on 2014-08-06
Status: Merged
Approved by: Sebastien Bacher on 2015-02-20
Approved revision: 434
Merged at revision: 670
Proposed branch: lp:~attente/indicator-keyboard/fcitx-transition
Merge into: lp:indicator-keyboard
Diff against target: 1817 lines (+450/-796)
17 files modified
.bzrignore (+11/-8)
configure.ac (+1/-32)
data/Makefile.am (+4/-4)
debian/control (+2/-0)
deps/Fcitx-1.0.metadata (+7/-0)
deps/GnomeDesktop-3.0.metadata (+1/-0)
deps/accountsservice.vapi (+0/-151)
deps/fontconfig.vapi (+0/-13)
deps/freetype2.vapi (+0/-20)
deps/gnome-desktop-3.0.vapi (+0/-320)
deps/pangoft2.vapi (+0/-33)
lib/Makefile.am (+5/-2)
lib/ibus-menu.vala (+13/-17)
lib/indicator-menu.vala (+50/-43)
lib/main.vala (+249/-94)
lib/source.vala (+106/-59)
tests/indicator-keyboard-test.in (+1/-0)
To merge this branch: bzr merge lp:~attente/indicator-keyboard/fcitx-transition
Reviewer Review Type Date Requested Status
Allison Lortie (community) Approve on 2015-03-03
Sebastien Bacher Approve on 2015-02-20
PS Jenkins bot continuous-integration Approve on 2015-02-19
Ted Gould (community) 2014-08-06 Approve on 2014-09-16
csslayer 2015-02-13 Pending
Review via email: mp+229737@code.launchpad.net

Commit Message

Basic support for Fcitx input sources.

Description of the Change

Basic support for Fcitx input sources.

To post a comment you must log in.
Ted Gould (ted) wrote :

So I read through this and I don't see any issues, but I don't really know how fcitx works, so any of the interactions are not known by me. Not sure if there's someone better to review this or not.

Ted Gould (ted) wrote :

I'll approve, but not top-approve in hoping there's someone else who can review better.

review: Approve
Ted Gould (ted) wrote :

Talking with Will this is going to have to be a 15.04 feature. I'm marking the review as a WIP as it'll need to be resubmitted to the 15.04 branch anyway.

William Hua (attente) wrote :

Hi Ted, could we please reconsider this for approval now that the Fcitx MIR is complete? I'll see if I can find another reviewer for it, maybe from the Kylin team.

Allison Lortie (desrt) wrote :

Without really appreciating what's going on with the input method side of this patch, see below about some code comments.

review: Needs Fixing
423. By William Hua on 2015-02-17

Remove unnecessary AC_SUBST.

424. By William Hua on 2015-02-17

Use shift operator.

425. By William Hua on 2015-02-17

Check flags better.

426. By William Hua on 2015-02-17

Only try initializing Fcitx once.

427. By William Hua on 2015-02-18

Remove (!) when possible.

428. By William Hua on 2015-02-18

Use foreach when possible.

429. By William Hua on 2015-02-18

Remove vapi.

430. By William Hua on 2015-02-18

Remove unnecessary flag.

We don't really need this flag any more since we decided to hide indicator-keyboard in the session when Fcitx is running since it has its own indicator.

William Hua (attente) wrote :

Thanks, I think that's all of the necessary changes, including removing the generated vapi files.

431. By William Hua on 2015-02-18

Build depend on gir1.2-fcitx-1.0.

Allison Lortie (desrt) wrote :

There's nothing wrong here, really -- just a few nitpicks. I wouldn't let it block the merge, or anything...

William Hua (attente) wrote :

I filed https://bugzilla.gnome.org/show_bug.cgi?id=744797 for the foreach+(!) issue.

William Hua (attente) wrote :

I don't think we ever scroll input sources by more than 1 at a time, but it's exposed via org.gtk.Actions over D-Bus, so I did that mod just in case. I'll re-write it though to explain why, and fix it so we only need one loop.

432. By William Hua on 2015-02-19

Don't handle activate signal when the default behaviour will do.

433. By William Hua on 2015-02-19

Simplify input source cycling.

434. By William Hua on 2015-02-19

Explain input source cycling logic.

Sebastien Bacher (seb128) wrote :

Thanks, that looks fine, let's get that in a silo on monday, with u-c-c and u-s-d

review: Approve
Allison Lortie (desrt) wrote :

No further comments.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.bzrignore'
2--- .bzrignore 2014-03-27 10:41:17 +0000
3+++ .bzrignore 2015-02-19 17:34:10 +0000
4@@ -10,15 +10,19 @@
5 .timestamp
6 Makefile
7 Makefile.in
8+aclocal.m4
9 autom4te.cache
10 build-aux
11 config.log
12 config.status
13 configure
14 data/com.canonical.indicator.keyboard
15+data/gschemas.compiled
16 data/indicator-keyboard-icon-generator
17+data/indicator-keyboard.conf
18+data/indicator-keyboard.desktop
19 data/indicator-keyboard.service
20-data/gschemas.compiled
21+data/upstart/indicator-keyboard.desktop
22 debian/autoreconf.after
23 debian/autoreconf.before
24 debian/files
25@@ -26,6 +30,12 @@
26 debian/tmp
27 lib/indicator-keyboard-service
28 libtool
29+m4/intltool.m4
30+m4/libtool.m4
31+m4/ltoptions.m4
32+m4/ltsugar.m4
33+m4/ltversion.m4
34+m4/lt~obsolete.m4
35 po/POTFILES
36 po/stamp-it
37 tests/config.vala
38@@ -35,10 +45,3 @@
39 tests/indicator-keyboard-test.trs
40 tests/indicator-keyboard-tests
41 tests/services/indicator-keyboard.service
42-aclocal.m4
43-m4/intltool.m4
44-m4/libtool.m4
45-m4/lt~obsolete.m4
46-m4/ltoptions.m4
47-m4/ltsugar.m4
48-m4/ltversion.m4
49
50=== modified file 'configure.ac'
51--- configure.ac 2014-02-20 04:34:41 +0000
52+++ configure.ac 2015-02-19 17:34:10 +0000
53@@ -35,48 +35,17 @@
54 GLIB_GSETTINGS
55
56 PKG_CHECK_MODULES([GEE], [gee-1.0])
57-AC_SUBST([GEE_CFLAGS])
58-AC_SUBST([GEE_LIBS])
59-
60 PKG_CHECK_MODULES([GIO], [gio-2.0])
61-AC_SUBST([GIO_CFLAGS])
62-AC_SUBST([GIO_LIBS])
63-
64 PKG_CHECK_MODULES([GTK], [gtk+-3.0])
65-AC_SUBST([GTK_CFLAGS])
66-AC_SUBST([GTK_LIBS])
67-
68 PKG_CHECK_MODULES([PANGOFT2], [pangoft2])
69-AC_SUBST([PANGOFT2_CFLAGS])
70-AC_SUBST([PANGOFT2_LIBS])
71-
72 PKG_CHECK_MODULES([PANGOCAIRO], [pangocairo])
73-AC_SUBST([PANGOCAIRO_CFLAGS])
74-AC_SUBST([PANGOCAIRO_LIBS])
75-
76 PKG_CHECK_MODULES([GNOME_DESKTOP], [gnome-desktop-3.0])
77-AC_SUBST([GNOME_DESKTOP_CFLAGS])
78-AC_SUBST([GNOME_DESKTOP_LIBS])
79-
80 PKG_CHECK_MODULES([LIBXKLAVIER], [libxklavier])
81-AC_SUBST([LIBXKLAVIER_CFLAGS])
82-AC_SUBST([LIBXKLAVIER_LIBS])
83-
84 PKG_CHECK_MODULES([LIBGNOMEKBD], [libgnomekbdui])
85-AC_SUBST([LIBGNOMEKBD_CFLAGS])
86-AC_SUBST([LIBGNOMEKBD_LIBS])
87-
88 PKG_CHECK_MODULES([IBUS], [ibus-1.0])
89-AC_SUBST([IBUS_CFLAGS])
90-AC_SUBST([IBUS_LIBS])
91-
92+PKG_CHECK_MODULES([FCITX_GCLIENT], [fcitx-gclient])
93 PKG_CHECK_MODULES([ACCOUNTSSERVICE], [accountsservice])
94-AC_SUBST([ACCOUNTSSERVICE_CFLAGS])
95-AC_SUBST([ACCOUNTSSERVICE_LIBS])
96-
97 PKG_CHECK_MODULES([LIGHTDM], [liblightdm-gobject-1])
98-AC_SUBST([LIGHTDM_CFLAGS])
99-AC_SUBST([LIGHTDM_LIBS])
100
101 m4_include([m4/gcov.m4])
102 AC_TDD_GCOV
103
104=== modified file 'data/Makefile.am'
105--- data/Makefile.am 2014-06-20 09:58:28 +0000
106+++ data/Makefile.am 2015-02-19 17:34:10 +0000
107@@ -17,12 +17,12 @@
108 $(top_srcdir)/lib/common.vala
109 indicator_keyboard_icon_generator_VALAFLAGS = $(AM_VALAFLAGS) \
110 --pkg gee-1.0 \
111- --pkg fontconfig \
112- --pkg freetype2 \
113- --pkg pangoft2 \
114+ --pkg fontconfig-2.0 \
115+ --pkg freetype2-2.0 \
116+ --pkg PangoFT2-1.0 \
117 --pkg gtk+-3.0 \
118 --pkg GDesktopEnums-3.0 \
119- --pkg gnome-desktop-3.0 \
120+ --pkg GnomeDesktop-3.0 \
121 --pkg Xkl-1.0
122 indicator_keyboard_icon_generator_CFLAGS = $(AM_CFLAGS) \
123 $(GEE_CFLAGS) \
124
125=== modified file 'debian/control'
126--- debian/control 2014-03-19 04:28:51 +0000
127+++ debian/control 2015-02-19 17:34:10 +0000
128@@ -7,6 +7,8 @@
129 dh-autoreconf,
130 dh-translations,
131 dbus,
132+ fcitx-libs-dev (>= 1:4.2.8.3),
133+ gir1.2-fcitx-1.0,
134 libaccountsservice-dev,
135 libgee-dev,
136 libgirepository1.0-dev,
137
138=== added file 'deps/Fcitx-1.0.metadata'
139--- deps/Fcitx-1.0.metadata 1970-01-01 00:00:00 +0000
140+++ deps/Fcitx-1.0.metadata 2015-02-19 17:34:10 +0000
141@@ -0,0 +1,7 @@
142+Client cheader_filename="fcitx-gclient/fcitxclient.h"
143+Connection cheader_filename="fcitx-gclient/fcitxconnection.h"
144+IMItem cheader_filename="fcitx-gclient/fcitxinputmethod.h"
145+InputMethod cheader_filename="fcitx-gclient/fcitxinputmethod.h"
146+Kbd cheader_filename="fcitx-gclient/fcitxkbd.h"
147+LayoutItem cheader_filename="fcitx-gclient/fcitxkbd.h"
148+PreeditItem cheader_filename="fcitx-gclient/fcitxclient.h"
149
150=== added file 'deps/GnomeDesktop-3.0.metadata'
151--- deps/GnomeDesktop-3.0.metadata 1970-01-01 00:00:00 +0000
152+++ deps/GnomeDesktop-3.0.metadata 2015-02-19 17:34:10 +0000
153@@ -0,0 +1,1 @@
154+RRScreen.new_async skip
155
156=== removed file 'deps/accountsservice.vapi'
157--- deps/accountsservice.vapi 2013-11-19 19:08:26 +0000
158+++ deps/accountsservice.vapi 1970-01-01 00:00:00 +0000
159@@ -1,151 +0,0 @@
160-/* accountsservice.vapi generated by vapigen, do not modify. */
161-
162-[CCode (cprefix = "Act", gir_namespace = "AccountsService", gir_version = "1.0", lower_case_cprefix = "act_")]
163-namespace Act {
164- [CCode (cheader_filename = "act/act.h", type_id = "act_user_get_type ()")]
165- public class User : GLib.Object {
166- [CCode (has_construct_function = false)]
167- protected User ();
168- public int collate (Act.User user2);
169- public Act.UserAccountType get_account_type ();
170- public bool get_automatic_login ();
171- public unowned string get_email ();
172- public unowned string get_formats_locale ();
173- public unowned string get_home_dir ();
174- public unowned string get_icon_file ();
175- public unowned GLib.Variant get_input_sources ();
176- public unowned string get_language ();
177- public unowned string get_location ();
178- public bool get_locked ();
179- public int get_login_frequency ();
180- public unowned GLib.Variant get_login_history ();
181- public int64 get_login_time ();
182- public uint get_num_sessions ();
183- public uint get_num_sessions_anywhere ();
184- public unowned string get_object_path ();
185- public unowned string get_password_hint ();
186- public Act.UserPasswordMode get_password_mode ();
187- public unowned string get_primary_session_id ();
188- public unowned string get_real_name ();
189- public unowned string get_shell ();
190- public uint get_uid ();
191- public unowned string get_user_name ();
192- public unowned string get_x_session ();
193- public bool is_local_account ();
194- public bool is_logged_in ();
195- public bool is_logged_in_anywhere ();
196- public bool is_nonexistent ();
197- public bool is_system_account ();
198- public void set_account_type (Act.UserAccountType account_type);
199- public void set_automatic_login (bool enabled);
200- public void set_email (string email);
201- public void set_formats_locale (string formats_locale);
202- public void set_icon_file (string icon_file);
203- public void set_input_sources (GLib.Variant sources);
204- public void set_language (string language);
205- public void set_location (string location);
206- public void set_locked (bool locked);
207- public void set_multiple_passwords (GLib.HashTable<uint,string> password_map);
208- public void set_password (string password, string hint);
209- public void set_password_mode (Act.UserPasswordMode password_mode);
210- public void set_real_name (string real_name);
211- public void set_user_name (string user_name);
212- public void set_x_session (string x_session);
213- public int account_type { get; }
214- public bool automatic_login { get; }
215- [NoAccessorMethod]
216- public string background_file { owned get; }
217- public string email { get; }
218- public string formats_locale { get; }
219- [NoAccessorMethod]
220- public string home_directory { owned get; }
221- public string icon_file { get; }
222- public GLib.Variant input_sources { get; }
223- [NoAccessorMethod]
224- public bool is_loaded { get; }
225- public string language { get; }
226- [NoAccessorMethod]
227- public bool local_account { get; }
228- public string location { get; }
229- public bool locked { get; }
230- public int login_frequency { get; }
231- public GLib.Variant login_history { get; }
232- public int64 login_time { get; }
233- [NoAccessorMethod]
234- public bool nonexistent { get; }
235- public string password_hint { get; }
236- public int password_mode { get; }
237- public string real_name { get; }
238- public string shell { get; }
239- [NoAccessorMethod]
240- public bool system_account { get; }
241- public int uid { get; }
242- public string user_name { get; }
243- public string x_session { get; }
244- [NoAccessorMethod]
245- public bool xhas_messages { get; }
246- [CCode (array_length = false, array_null_terminated = true)]
247- [NoAccessorMethod]
248- public string[] xkeyboard_layouts { owned get; }
249- public signal void changed ();
250- public signal void sessions_changed ();
251- }
252- [CCode (cheader_filename = "act/act.h", type_id = "act_user_manager_get_type ()")]
253- public class UserManager : GLib.Object {
254- [CCode (has_construct_function = false)]
255- protected UserManager ();
256- public bool activate_user_session (Act.User user);
257- public Act.User cache_user (string username) throws GLib.Error;
258- public async Act.User cache_user_async (string username, GLib.Cancellable? cancellable) throws GLib.Error;
259- public bool can_switch ();
260- public Act.User create_user (string username, string fullname, Act.UserAccountType accounttype) throws GLib.Error;
261- public async Act.User create_user_async (string username, string fullname, Act.UserAccountType accounttype, GLib.Cancellable? cancellable) throws GLib.Error;
262- public bool delete_user (Act.User user, bool remove_files) throws GLib.Error;
263- public async bool delete_user_async (Act.User user, bool remove_files, GLib.Cancellable? cancellable) throws GLib.Error;
264- public static unowned Act.UserManager get_default ();
265- public unowned Act.User get_user (string username);
266- public unowned Act.User get_user_by_id (uint id);
267- public bool goto_login_session ();
268- public GLib.SList<weak Act.User> list_users ();
269- public bool no_service ();
270- public bool uncache_user (string username) throws GLib.Error;
271- [NoAccessorMethod]
272- public void* exclude_usernames_list { get; set; }
273- [NoAccessorMethod]
274- public bool has_multiple_users { get; }
275- [NoAccessorMethod]
276- public void* include_usernames_list { get; set; }
277- [NoAccessorMethod]
278- public bool is_loaded { get; }
279- public virtual signal void user_added (Act.User user);
280- public virtual signal void user_changed (Act.User user);
281- public virtual signal void user_is_logged_in_changed (Act.User user);
282- public virtual signal void user_removed (Act.User user);
283- }
284- [CCode (cheader_filename = "act/act.h", cprefix = "ACT_USER_ACCOUNT_TYPE_", type_id = "act_user_account_type_get_type ()")]
285- public enum UserAccountType {
286- STANDARD,
287- ADMINISTRATOR
288- }
289- [CCode (cheader_filename = "act/act.h", cprefix = "ACT_USER_PASSWORD_MODE_", type_id = "act_user_password_mode_get_type ()")]
290- public enum UserPasswordMode {
291- REGULAR,
292- SET_AT_LOGIN,
293- NONE
294- }
295- [CCode (cheader_filename = "act/act.h", cprefix = "ACT_USER_PASSWORD_", type_id = "act_user_password_type_get_type ()")]
296- public enum UserPasswordType {
297- REGULAR,
298- HINT,
299- PIN
300- }
301- [CCode (cheader_filename = "act/act.h", cprefix = "ACT_USER_MANAGER_ERROR_")]
302- public errordomain UserManagerError {
303- FAILED,
304- USER_EXISTS,
305- USER_DOES_NOT_EXIST,
306- PERMISSION_DENIED,
307- NOT_SUPPORTED;
308- public static GLib.Quark quark ();
309- }
310-}
311
312=== removed file 'deps/fontconfig.vapi'
313--- deps/fontconfig.vapi 2013-06-06 00:45:45 +0000
314+++ deps/fontconfig.vapi 1970-01-01 00:00:00 +0000
315@@ -1,13 +0,0 @@
316-/* fontconfig.vapi generated by vapigen, do not modify. */
317-
318-[CCode (cprefix = "Fc", gir_namespace = "fontconfig", gir_version = "2.0", lower_case_cprefix = "fc_")]
319-namespace Fc {
320- [CCode (cheader_filename = "fontconfig-2.0.h", has_type_id = false)]
321- public struct CharSet {
322- }
323- [CCode (cheader_filename = "fontconfig-2.0.h", has_type_id = false)]
324- public struct Pattern {
325- }
326- [CCode (cheader_filename = "fontconfig-2.0.h", cname = "FcInit")]
327- public static void init ();
328-}
329
330=== removed file 'deps/freetype2.vapi'
331--- deps/freetype2.vapi 2013-06-06 00:45:45 +0000
332+++ deps/freetype2.vapi 1970-01-01 00:00:00 +0000
333@@ -1,20 +0,0 @@
334-/* freetype2.vapi generated by vapigen, do not modify. */
335-
336-[CCode (cprefix = "FT", gir_namespace = "freetype2", gir_version = "2.0", lower_case_cprefix = "FT_")]
337-namespace FT {
338- [CCode (cheader_filename = "freetype2-2.0.h", cname = "FT_Bitmap", has_type_id = false)]
339- public struct Bitmap {
340- }
341- [CCode (cheader_filename = "freetype2-2.0.h", cname = "FT_Face", has_type_id = false)]
342- public struct Face {
343- }
344- [CCode (cheader_filename = "freetype2-2.0.h", cname = "FT_Int32")]
345- [SimpleType]
346- public struct Int32 : int32 {
347- }
348- [CCode (cheader_filename = "freetype2-2.0.h", cname = "FT_Library", has_type_id = false)]
349- public struct Library {
350- }
351- [CCode (cheader_filename = "freetype2-2.0.h", cname = "FT_Library_Version")]
352- public static void library_version ();
353-}
354
355=== removed file 'deps/gnome-desktop-3.0.vapi'
356--- deps/gnome-desktop-3.0.vapi 2013-06-04 13:48:52 +0000
357+++ deps/gnome-desktop-3.0.vapi 1970-01-01 00:00:00 +0000
358@@ -1,320 +0,0 @@
359-/* gnome-desktop-3.0.vapi generated by vapigen, do not modify. */
360-
361-[CCode (cprefix = "Gnome", gir_namespace = "GnomeDesktop", gir_version = "3.0", lower_case_cprefix = "gnome_")]
362-namespace Gnome {
363- [CCode (cheader_filename = "libgnome-desktop/gnome-bg-crossfade.h,libgnome-desktop/gnome-bg-slide-show.h,libgnome-desktop/gnome-bg.h,libgnome-desktop/gnome-desktop-thumbnail.h,libgnome-desktop/gnome-idle-monitor.h,libgnome-desktop/gnome-languages.h,libgnome-desktop/gnome-pnp-ids.h,libgnome-desktop/gnome-rr-config.h,libgnome-desktop/gnome-rr.h,libgnome-desktop/gnome-wall-clock.h,libgnome-desktop/gnome-xkb-info.h", type_id = "gnome_bg_get_type ()")]
364- public class BG : GLib.Object {
365- [CCode (has_construct_function = false)]
366- public BG ();
367- public bool changes_with_time ();
368- public Gdk.Pixbuf create_frame_thumbnail (Gnome.DesktopThumbnailFactory factory, Gdk.Screen screen, int dest_width, int dest_height, int frame_num);
369- public Cairo.Surface create_surface (Gdk.Window window, int width, int height, bool root);
370- public Gdk.Pixbuf create_thumbnail (Gnome.DesktopThumbnailFactory factory, Gdk.Screen screen, int dest_width, int dest_height);
371- public void draw (Gdk.Pixbuf dest, Gdk.Screen screen, bool is_root);
372- public void get_color (GDesktop.BackgroundShading type, Gdk.Color primary, Gdk.Color secondary);
373- public bool get_draw_background ();
374- public unowned string get_filename ();
375- public bool get_image_size (Gnome.DesktopThumbnailFactory factory, int best_width, int best_height, int width, int height);
376- public GDesktop.BackgroundStyle get_placement ();
377- public static Cairo.Surface get_surface_from_root (Gdk.Screen screen);
378- public bool has_multiple_sizes ();
379- public bool is_dark (int dest_width, int dest_height);
380- public void load_from_preferences (GLib.Settings settings);
381- public void save_to_preferences (GLib.Settings settings);
382- public void set_color (GDesktop.BackgroundShading type, Gdk.Color primary, Gdk.Color secondary);
383- public void set_draw_background (bool draw_background);
384- public void set_filename (string filename);
385- public void set_placement (GDesktop.BackgroundStyle placement);
386- public static void set_surface_as_root (Gdk.Screen screen, Cairo.Surface surface);
387- public static Gnome.BGCrossfade set_surface_as_root_with_crossfade (Gdk.Screen screen, Cairo.Surface surface);
388- public signal void changed ();
389- public signal void transitioned ();
390- }
391- [CCode (cheader_filename = "libgnome-desktop/gnome-bg-crossfade.h,libgnome-desktop/gnome-bg-slide-show.h,libgnome-desktop/gnome-bg.h,libgnome-desktop/gnome-desktop-thumbnail.h,libgnome-desktop/gnome-idle-monitor.h,libgnome-desktop/gnome-languages.h,libgnome-desktop/gnome-pnp-ids.h,libgnome-desktop/gnome-rr-config.h,libgnome-desktop/gnome-rr.h,libgnome-desktop/gnome-wall-clock.h,libgnome-desktop/gnome-xkb-info.h", type_id = "gnome_bg_crossfade_get_type ()")]
392- public class BGCrossfade : GLib.Object {
393- [CCode (has_construct_function = false)]
394- public BGCrossfade (int width, int height);
395- public bool is_started ();
396- public bool set_end_surface (Cairo.Surface surface);
397- public bool set_start_surface (Cairo.Surface surface);
398- public void start (Gdk.Window window);
399- public void stop ();
400- [NoAccessorMethod]
401- public int height { get; construct; }
402- [NoAccessorMethod]
403- public int width { get; construct; }
404- public virtual signal void finished (GLib.Object window);
405- }
406- [CCode (cheader_filename = "libgnome-desktop/gnome-bg-crossfade.h,libgnome-desktop/gnome-bg-slide-show.h,libgnome-desktop/gnome-bg.h,libgnome-desktop/gnome-desktop-thumbnail.h,libgnome-desktop/gnome-idle-monitor.h,libgnome-desktop/gnome-languages.h,libgnome-desktop/gnome-pnp-ids.h,libgnome-desktop/gnome-rr-config.h,libgnome-desktop/gnome-rr.h,libgnome-desktop/gnome-wall-clock.h,libgnome-desktop/gnome-xkb-info.h", type_id = "gnome_bg_slide_show_get_type ()")]
407- public class BGSlideShow : GLib.Object {
408- [CCode (has_construct_function = false)]
409- public BGSlideShow (string filename);
410- public void get_current_slide (int width, int height, out double progress, out double duration, out bool is_fixed, out unowned string file1, out unowned string file2);
411- public bool get_has_multiple_sizes ();
412- public int get_num_slides ();
413- public bool get_slide (int frame_number, int width, int height, double progress, out double duration, out bool is_fixed, out unowned string file1, out unowned string file2);
414- public double get_start_time ();
415- public double get_total_duration ();
416- public bool load () throws GLib.Error;
417- public async void load_async (GLib.Cancellable? cancellable);
418- [NoAccessorMethod]
419- public string filename { owned get; construct; }
420- public bool has_multiple_sizes { get; }
421- public double start_time { get; }
422- public double total_duration { get; }
423- }
424- [CCode (cheader_filename = "libgnome-desktop/gnome-bg-crossfade.h,libgnome-desktop/gnome-bg-slide-show.h,libgnome-desktop/gnome-bg.h,libgnome-desktop/gnome-desktop-thumbnail.h,libgnome-desktop/gnome-idle-monitor.h,libgnome-desktop/gnome-languages.h,libgnome-desktop/gnome-pnp-ids.h,libgnome-desktop/gnome-rr-config.h,libgnome-desktop/gnome-rr.h,libgnome-desktop/gnome-wall-clock.h,libgnome-desktop/gnome-xkb-info.h", type_id = "gnome_desktop_thumbnail_factory_get_type ()")]
425- public class DesktopThumbnailFactory : GLib.Object {
426- [CCode (has_construct_function = false)]
427- public DesktopThumbnailFactory (Gnome.DesktopThumbnailSize size);
428- public bool can_thumbnail (string uri, string mime_type, long mtime);
429- public void create_failed_thumbnail (string uri, long mtime);
430- public Gdk.Pixbuf generate_thumbnail (string uri, string mime_type);
431- public bool has_valid_failed_thumbnail (string uri, long mtime);
432- public string lookup (string uri, long mtime);
433- public void save_thumbnail (Gdk.Pixbuf thumbnail, string uri, long original_mtime);
434- }
435- [CCode (cheader_filename = "libgnome-desktop/gnome-bg-crossfade.h,libgnome-desktop/gnome-bg-slide-show.h,libgnome-desktop/gnome-bg.h,libgnome-desktop/gnome-desktop-thumbnail.h,libgnome-desktop/gnome-idle-monitor.h,libgnome-desktop/gnome-languages.h,libgnome-desktop/gnome-pnp-ids.h,libgnome-desktop/gnome-rr-config.h,libgnome-desktop/gnome-rr.h,libgnome-desktop/gnome-wall-clock.h,libgnome-desktop/gnome-xkb-info.h", type_id = "gnome_idle_monitor_get_type ()")]
436- public class IdleMonitor : GLib.Object, GLib.Initable {
437- [CCode (has_construct_function = false)]
438- public IdleMonitor ();
439- public uint add_idle_watch (uint64 interval_msec, owned Gnome.IdleMonitorWatchFunc? callback);
440- public uint add_user_active_watch (owned Gnome.IdleMonitorWatchFunc? callback);
441- [CCode (has_construct_function = false)]
442- public IdleMonitor.for_device (Gdk.Device device);
443- public int64 get_idletime ();
444- public void remove_watch (uint id);
445- [NoAccessorMethod]
446- public Gdk.Device device { owned get; construct; }
447- }
448- [CCode (cheader_filename = "libgnome-desktop/gnome-bg-crossfade.h,libgnome-desktop/gnome-bg-slide-show.h,libgnome-desktop/gnome-bg.h,libgnome-desktop/gnome-desktop-thumbnail.h,libgnome-desktop/gnome-idle-monitor.h,libgnome-desktop/gnome-languages.h,libgnome-desktop/gnome-pnp-ids.h,libgnome-desktop/gnome-rr-config.h,libgnome-desktop/gnome-rr.h,libgnome-desktop/gnome-wall-clock.h,libgnome-desktop/gnome-xkb-info.h", type_id = "gnome_pnp_ids_get_type ()")]
449- public class PnpIds : GLib.Object {
450- [CCode (has_construct_function = false)]
451- public PnpIds ();
452- public string get_pnp_id (string pnp_id);
453- }
454- [CCode (cheader_filename = "libgnome-desktop/gnome-bg-crossfade.h,libgnome-desktop/gnome-bg-slide-show.h,libgnome-desktop/gnome-bg.h,libgnome-desktop/gnome-desktop-thumbnail.h,libgnome-desktop/gnome-idle-monitor.h,libgnome-desktop/gnome-languages.h,libgnome-desktop/gnome-pnp-ids.h,libgnome-desktop/gnome-rr-config.h,libgnome-desktop/gnome-rr.h,libgnome-desktop/gnome-wall-clock.h,libgnome-desktop/gnome-xkb-info.h", type_id = "gnome_rr_config_get_type ()")]
455- public class RRConfig : GLib.Object {
456- [CCode (has_construct_function = false)]
457- protected RRConfig ();
458- public bool applicable (Gnome.RRScreen screen) throws GLib.Error;
459- public static bool apply_from_filename_with_time (Gnome.RRScreen screen, string filename, uint32 timestamp) throws GLib.Error;
460- public bool apply_with_time (Gnome.RRScreen screen, uint32 timestamp) throws GLib.Error;
461- [CCode (has_construct_function = false)]
462- public RRConfig.current (Gnome.RRScreen screen) throws GLib.Error;
463- public bool ensure_primary ();
464- public bool equal (Gnome.RRConfig config2);
465- public static string get_backup_filename ();
466- public bool get_clone ();
467- public static string get_intended_filename ();
468- [CCode (array_length = false, array_null_terminated = true)]
469- public unowned Gnome.RROutputInfo[] get_outputs ();
470- public bool load_current () throws GLib.Error;
471- public bool load_filename (string filename) throws GLib.Error;
472- public bool match (Gnome.RRConfig config2);
473- public void sanitize ();
474- public bool save () throws GLib.Error;
475- public void set_clone (bool clone);
476- [CCode (has_construct_function = false)]
477- public RRConfig.stored (Gnome.RRScreen screen) throws GLib.Error;
478- public Gnome.RRScreen screen { construct; }
479- }
480- [CCode (cheader_filename = "libgnome-desktop/gnome-bg-crossfade.h,libgnome-desktop/gnome-bg-slide-show.h,libgnome-desktop/gnome-bg.h,libgnome-desktop/gnome-desktop-thumbnail.h,libgnome-desktop/gnome-idle-monitor.h,libgnome-desktop/gnome-languages.h,libgnome-desktop/gnome-pnp-ids.h,libgnome-desktop/gnome-rr-config.h,libgnome-desktop/gnome-rr.h,libgnome-desktop/gnome-wall-clock.h,libgnome-desktop/gnome-xkb-info.h", copy_function = "g_boxed_copy", free_function = "g_boxed_free", type_id = "gnome_rr_crtc_get_type ()")]
481- [Compact]
482- public class RRCrtc {
483- public bool can_drive_output (Gnome.RROutput output);
484- public Gnome.RRMode get_current_mode ();
485- public Gnome.RRRotation get_current_rotation ();
486- public bool get_gamma (int size, ushort red, ushort green, ushort blue);
487- public uint32 get_id ();
488- public void get_position (out int x, out int y);
489- public Gnome.RRRotation get_rotations ();
490- public bool set_config_with_time (uint32 timestamp, int x, int y, Gnome.RRMode mode, Gnome.RRRotation rotation, Gnome.RROutput outputs, int n_outputs) throws GLib.Error;
491- public void set_gamma (int size, ushort red, ushort green, ushort blue);
492- public bool supports_rotation (Gnome.RRRotation rotation);
493- }
494- [CCode (cheader_filename = "libgnome-desktop/gnome-bg-crossfade.h,libgnome-desktop/gnome-bg-slide-show.h,libgnome-desktop/gnome-bg.h,libgnome-desktop/gnome-desktop-thumbnail.h,libgnome-desktop/gnome-idle-monitor.h,libgnome-desktop/gnome-languages.h,libgnome-desktop/gnome-pnp-ids.h,libgnome-desktop/gnome-rr-config.h,libgnome-desktop/gnome-rr.h,libgnome-desktop/gnome-wall-clock.h,libgnome-desktop/gnome-xkb-info.h", copy_function = "g_boxed_copy", free_function = "g_boxed_free", type_id = "gnome_rr_mode_get_type ()")]
495- [Compact]
496- public class RRMode {
497- public int get_freq ();
498- public uint get_height ();
499- public uint32 get_id ();
500- public uint get_width ();
501- }
502- [CCode (cheader_filename = "libgnome-desktop/gnome-bg-crossfade.h,libgnome-desktop/gnome-bg-slide-show.h,libgnome-desktop/gnome-bg.h,libgnome-desktop/gnome-desktop-thumbnail.h,libgnome-desktop/gnome-idle-monitor.h,libgnome-desktop/gnome-languages.h,libgnome-desktop/gnome-pnp-ids.h,libgnome-desktop/gnome-rr-config.h,libgnome-desktop/gnome-rr.h,libgnome-desktop/gnome-wall-clock.h,libgnome-desktop/gnome-xkb-info.h", copy_function = "g_boxed_copy", free_function = "g_boxed_free", type_id = "gnome_rr_output_get_type ()")]
503- [Compact]
504- public class RROutput {
505- public bool can_clone (Gnome.RROutput clone);
506- public int get_backlight () throws GLib.Error;
507- public int get_backlight_max ();
508- public int get_backlight_min ();
509- public unowned string get_connector_type ();
510- public Gnome.RRCrtc get_crtc ();
511- public Gnome.RRMode get_current_mode ();
512- public unowned string get_display_name ();
513- public uint8 get_edid_data (size_t size);
514- public int get_height_mm ();
515- public uint32 get_id ();
516- public bool get_ids_from_edid (out string vendor, out int product, out int serial);
517- public bool get_is_primary ();
518- public unowned string get_name ();
519- public void get_position (out int x, out int y);
520- public Gnome.RRCrtc get_possible_crtcs ();
521- public Gnome.RRMode get_preferred_mode ();
522- public int get_size_inches ();
523- public int get_width_mm ();
524- public bool is_connected ();
525- public bool is_laptop ();
526- public Gnome.RRMode list_modes ();
527- public bool set_backlight (int value) throws GLib.Error;
528- public bool supports_mode (Gnome.RRMode mode);
529- }
530- [CCode (cheader_filename = "libgnome-desktop/gnome-bg-crossfade.h,libgnome-desktop/gnome-bg-slide-show.h,libgnome-desktop/gnome-bg.h,libgnome-desktop/gnome-desktop-thumbnail.h,libgnome-desktop/gnome-idle-monitor.h,libgnome-desktop/gnome-languages.h,libgnome-desktop/gnome-pnp-ids.h,libgnome-desktop/gnome-rr-config.h,libgnome-desktop/gnome-rr.h,libgnome-desktop/gnome-wall-clock.h,libgnome-desktop/gnome-xkb-info.h", type_id = "gnome_rr_output_info_get_type ()")]
531- public class RROutputInfo : GLib.Object {
532- [CCode (has_construct_function = false)]
533- protected RROutputInfo ();
534- public double get_aspect_ratio ();
535- public unowned string get_display_name ();
536- public void get_geometry (out int x, out int y, out int width, out int height);
537- public unowned string get_name ();
538- public int get_preferred_height ();
539- public int get_preferred_width ();
540- public bool get_primary ();
541- public uint get_product ();
542- public int get_refresh_rate ();
543- public Gnome.RRRotation get_rotation ();
544- public uint get_serial ();
545- public void get_vendor ([CCode (array_length = false)] out unowned string[] vendor);
546- public bool is_active ();
547- public bool is_connected ();
548- public void set_active (bool active);
549- public void set_geometry (int x, int y, int width, int height);
550- public void set_primary (bool primary);
551- public void set_refresh_rate (int rate);
552- public void set_rotation (Gnome.RRRotation rotation);
553- }
554- [CCode (cheader_filename = "libgnome-desktop/gnome-bg-crossfade.h,libgnome-desktop/gnome-bg-slide-show.h,libgnome-desktop/gnome-bg.h,libgnome-desktop/gnome-desktop-thumbnail.h,libgnome-desktop/gnome-idle-monitor.h,libgnome-desktop/gnome-languages.h,libgnome-desktop/gnome-pnp-ids.h,libgnome-desktop/gnome-rr-config.h,libgnome-desktop/gnome-rr.h,libgnome-desktop/gnome-wall-clock.h,libgnome-desktop/gnome-xkb-info.h", type_id = "gnome_rr_screen_get_type ()")]
555- public class RRScreen : GLib.Object, GLib.Initable {
556- [CCode (has_construct_function = false)]
557- public RRScreen (Gdk.Screen screen) throws GLib.Error;
558- public Gnome.RRMode create_clone_modes ();
559- public unowned Gnome.RRCrtc get_crtc_by_id (uint32 id);
560- public bool get_dpms_mode (out Gnome.RRDpmsMode mode) throws GLib.Error;
561- public unowned Gnome.RROutput get_output_by_id (uint32 id);
562- public unowned Gnome.RROutput get_output_by_name (string name);
563- public void get_ranges (out int min_width, out int max_width, out int min_height, out int max_height);
564- public void get_timestamps (out uint32 change_timestamp_ret, out uint32 config_timestamp_ret);
565- [CCode (array_length = false, array_null_terminated = true)]
566- public unowned Gnome.RRMode[] list_clone_modes ();
567- [CCode (array_length = false, array_null_terminated = true)]
568- public unowned Gnome.RRCrtc[] list_crtcs ();
569- [CCode (array_length = false, array_null_terminated = true)]
570- public unowned Gnome.RRMode[] list_modes ();
571- [CCode (array_length = false, array_null_terminated = true)]
572- public unowned Gnome.RROutput[] list_outputs ();
573- public bool refresh () throws GLib.Error;
574- public bool set_dpms_mode (Gnome.RRDpmsMode mode) throws GLib.Error;
575- public void set_primary_output (Gnome.RROutput output);
576- public void set_size (int width, int height, int mm_width, int mm_height);
577- [NoAccessorMethod]
578- public Gdk.Screen gdk_screen { owned get; construct; }
579- public virtual signal void changed ();
580- public virtual signal void output_connected (void* output);
581- public virtual signal void output_disconnected (void* output);
582- }
583- [CCode (cheader_filename = "libgnome-desktop/gnome-bg-crossfade.h,libgnome-desktop/gnome-bg-slide-show.h,libgnome-desktop/gnome-bg.h,libgnome-desktop/gnome-desktop-thumbnail.h,libgnome-desktop/gnome-idle-monitor.h,libgnome-desktop/gnome-languages.h,libgnome-desktop/gnome-pnp-ids.h,libgnome-desktop/gnome-rr-config.h,libgnome-desktop/gnome-rr.h,libgnome-desktop/gnome-wall-clock.h,libgnome-desktop/gnome-xkb-info.h", type_id = "gnome_wall_clock_get_type ()")]
584- public class WallClock : GLib.Object {
585- [CCode (has_construct_function = false)]
586- public WallClock ();
587- public unowned string get_clock ();
588- public unowned GLib.TimeZone get_timezone ();
589- public string clock { get; }
590- [NoAccessorMethod]
591- public bool time_only { get; set; }
592- public GLib.TimeZone timezone { get; }
593- }
594- [CCode (cheader_filename = "libgnome-desktop/gnome-bg-crossfade.h,libgnome-desktop/gnome-bg-slide-show.h,libgnome-desktop/gnome-bg.h,libgnome-desktop/gnome-desktop-thumbnail.h,libgnome-desktop/gnome-idle-monitor.h,libgnome-desktop/gnome-languages.h,libgnome-desktop/gnome-pnp-ids.h,libgnome-desktop/gnome-rr-config.h,libgnome-desktop/gnome-rr.h,libgnome-desktop/gnome-wall-clock.h,libgnome-desktop/gnome-xkb-info.h", type_id = "gnome_xkb_info_get_type ()")]
595- public class XkbInfo : GLib.Object {
596- [CCode (has_construct_function = false)]
597- public XkbInfo ();
598- public unowned string description_for_group (string group_id);
599- public unowned string description_for_option (string group_id, string id);
600- public GLib.List<weak string> get_all_layouts ();
601- public GLib.List<weak string> get_all_option_groups ();
602- public bool get_layout_info (string id, out unowned string display_name, out unowned string short_name, out unowned string xkb_layout, out unowned string xkb_variant);
603- public GLib.List<weak string> get_layouts_for_country (string country_code);
604- public GLib.List<weak string> get_layouts_for_language (string language_code);
605- public GLib.List<weak string> get_options_for_group (string group_id);
606- }
607- [CCode (cheader_filename = "libgnome-desktop/gnome-bg-crossfade.h,libgnome-desktop/gnome-bg-slide-show.h,libgnome-desktop/gnome-bg.h,libgnome-desktop/gnome-desktop-thumbnail.h,libgnome-desktop/gnome-idle-monitor.h,libgnome-desktop/gnome-languages.h,libgnome-desktop/gnome-pnp-ids.h,libgnome-desktop/gnome-rr-config.h,libgnome-desktop/gnome-rr.h,libgnome-desktop/gnome-wall-clock.h,libgnome-desktop/gnome-xkb-info.h", cprefix = "GNOME_DESKTOP_THUMBNAIL_SIZE_", has_type_id = false)]
608- public enum DesktopThumbnailSize {
609- NORMAL,
610- LARGE
611- }
612- [CCode (cheader_filename = "libgnome-desktop/gnome-bg-crossfade.h,libgnome-desktop/gnome-bg-slide-show.h,libgnome-desktop/gnome-bg.h,libgnome-desktop/gnome-desktop-thumbnail.h,libgnome-desktop/gnome-idle-monitor.h,libgnome-desktop/gnome-languages.h,libgnome-desktop/gnome-pnp-ids.h,libgnome-desktop/gnome-rr-config.h,libgnome-desktop/gnome-rr.h,libgnome-desktop/gnome-wall-clock.h,libgnome-desktop/gnome-xkb-info.h", cprefix = "GNOME_RR_DPMS_", has_type_id = false)]
613- public enum RRDpmsMode {
614- ON,
615- STANDBY,
616- SUSPEND,
617- OFF,
618- DISABLED,
619- UNKNOWN
620- }
621- [CCode (cheader_filename = "libgnome-desktop/gnome-bg-crossfade.h,libgnome-desktop/gnome-bg-slide-show.h,libgnome-desktop/gnome-bg.h,libgnome-desktop/gnome-desktop-thumbnail.h,libgnome-desktop/gnome-idle-monitor.h,libgnome-desktop/gnome-languages.h,libgnome-desktop/gnome-pnp-ids.h,libgnome-desktop/gnome-rr-config.h,libgnome-desktop/gnome-rr.h,libgnome-desktop/gnome-wall-clock.h,libgnome-desktop/gnome-xkb-info.h", cprefix = "GNOME_RR_", has_type_id = false)]
622- [Flags]
623- public enum RRRotation {
624- ROTATION_NEXT,
625- ROTATION_0,
626- ROTATION_90,
627- ROTATION_180,
628- ROTATION_270,
629- REFLECT_X,
630- REFLECT_Y
631- }
632- [CCode (cheader_filename = "libgnome-desktop/gnome-bg-crossfade.h,libgnome-desktop/gnome-bg-slide-show.h,libgnome-desktop/gnome-bg.h,libgnome-desktop/gnome-desktop-thumbnail.h,libgnome-desktop/gnome-idle-monitor.h,libgnome-desktop/gnome-languages.h,libgnome-desktop/gnome-pnp-ids.h,libgnome-desktop/gnome-rr-config.h,libgnome-desktop/gnome-rr.h,libgnome-desktop/gnome-wall-clock.h,libgnome-desktop/gnome-xkb-info.h", cprefix = "GNOME_RR_ERROR_")]
633- public errordomain RRError {
634- UNKNOWN,
635- NO_RANDR_EXTENSION,
636- RANDR_ERROR,
637- BOUNDS_ERROR,
638- CRTC_ASSIGNMENT,
639- NO_MATCHING_CONFIG,
640- NO_DPMS_EXTENSION;
641- public static GLib.Quark quark ();
642- }
643- [CCode (cheader_filename = "libgnome-desktop/gnome-bg-crossfade.h,libgnome-desktop/gnome-bg-slide-show.h,libgnome-desktop/gnome-bg.h,libgnome-desktop/gnome-desktop-thumbnail.h,libgnome-desktop/gnome-idle-monitor.h,libgnome-desktop/gnome-languages.h,libgnome-desktop/gnome-pnp-ids.h,libgnome-desktop/gnome-rr-config.h,libgnome-desktop/gnome-rr.h,libgnome-desktop/gnome-wall-clock.h,libgnome-desktop/gnome-xkb-info.h", instance_pos = 2.9)]
644- public delegate void IdleMonitorWatchFunc (Gnome.IdleMonitor monitor, uint id);
645- [CCode (cheader_filename = "libgnome-desktop/gnome-bg-crossfade.h,libgnome-desktop/gnome-bg-slide-show.h,libgnome-desktop/gnome-bg.h,libgnome-desktop/gnome-desktop-thumbnail.h,libgnome-desktop/gnome-idle-monitor.h,libgnome-desktop/gnome-languages.h,libgnome-desktop/gnome-pnp-ids.h,libgnome-desktop/gnome-rr-config.h,libgnome-desktop/gnome-rr.h,libgnome-desktop/gnome-wall-clock.h,libgnome-desktop/gnome-xkb-info.h", cname = "GNOME_RR_CONNECTOR_TYPE_PANEL")]
646- public const string RR_CONNECTOR_TYPE_PANEL;
647- [CCode (cheader_filename = "libgnome-desktop/gnome-bg-crossfade.h,libgnome-desktop/gnome-bg-slide-show.h,libgnome-desktop/gnome-bg.h,libgnome-desktop/gnome-desktop-thumbnail.h,libgnome-desktop/gnome-idle-monitor.h,libgnome-desktop/gnome-languages.h,libgnome-desktop/gnome-pnp-ids.h,libgnome-desktop/gnome-rr-config.h,libgnome-desktop/gnome-rr.h,libgnome-desktop/gnome-wall-clock.h,libgnome-desktop/gnome-xkb-info.h")]
648- public static bool desktop_thumbnail_has_uri (Gdk.Pixbuf pixbuf, string uri);
649- [CCode (cheader_filename = "libgnome-desktop/gnome-bg-crossfade.h,libgnome-desktop/gnome-bg-slide-show.h,libgnome-desktop/gnome-bg.h,libgnome-desktop/gnome-desktop-thumbnail.h,libgnome-desktop/gnome-idle-monitor.h,libgnome-desktop/gnome-languages.h,libgnome-desktop/gnome-pnp-ids.h,libgnome-desktop/gnome-rr-config.h,libgnome-desktop/gnome-rr.h,libgnome-desktop/gnome-wall-clock.h,libgnome-desktop/gnome-xkb-info.h")]
650- public static bool desktop_thumbnail_is_valid (Gdk.Pixbuf pixbuf, string uri, long mtime);
651- [CCode (cheader_filename = "libgnome-desktop/gnome-bg-crossfade.h,libgnome-desktop/gnome-bg-slide-show.h,libgnome-desktop/gnome-bg.h,libgnome-desktop/gnome-desktop-thumbnail.h,libgnome-desktop/gnome-idle-monitor.h,libgnome-desktop/gnome-languages.h,libgnome-desktop/gnome-pnp-ids.h,libgnome-desktop/gnome-rr-config.h,libgnome-desktop/gnome-rr.h,libgnome-desktop/gnome-wall-clock.h,libgnome-desktop/gnome-xkb-info.h")]
652- [Deprecated (since = "2.22")]
653- public static string desktop_thumbnail_md5 (string uri);
654- [CCode (cheader_filename = "libgnome-desktop/gnome-bg-crossfade.h,libgnome-desktop/gnome-bg-slide-show.h,libgnome-desktop/gnome-bg.h,libgnome-desktop/gnome-desktop-thumbnail.h,libgnome-desktop/gnome-idle-monitor.h,libgnome-desktop/gnome-languages.h,libgnome-desktop/gnome-pnp-ids.h,libgnome-desktop/gnome-rr-config.h,libgnome-desktop/gnome-rr.h,libgnome-desktop/gnome-wall-clock.h,libgnome-desktop/gnome-xkb-info.h")]
655- public static string desktop_thumbnail_path_for_uri (string uri, Gnome.DesktopThumbnailSize size);
656- [CCode (cheader_filename = "libgnome-desktop/gnome-bg-crossfade.h,libgnome-desktop/gnome-bg-slide-show.h,libgnome-desktop/gnome-bg.h,libgnome-desktop/gnome-desktop-thumbnail.h,libgnome-desktop/gnome-idle-monitor.h,libgnome-desktop/gnome-languages.h,libgnome-desktop/gnome-pnp-ids.h,libgnome-desktop/gnome-rr-config.h,libgnome-desktop/gnome-rr.h,libgnome-desktop/gnome-wall-clock.h,libgnome-desktop/gnome-xkb-info.h")]
657- public static Gdk.Pixbuf desktop_thumbnail_scale_down_pixbuf (Gdk.Pixbuf pixbuf, int dest_width, int dest_height);
658- [CCode (array_length = false, array_null_terminated = true, cheader_filename = "libgnome-desktop/gnome-bg-crossfade.h,libgnome-desktop/gnome-bg-slide-show.h,libgnome-desktop/gnome-bg.h,libgnome-desktop/gnome-desktop-thumbnail.h,libgnome-desktop/gnome-idle-monitor.h,libgnome-desktop/gnome-languages.h,libgnome-desktop/gnome-pnp-ids.h,libgnome-desktop/gnome-rr-config.h,libgnome-desktop/gnome-rr.h,libgnome-desktop/gnome-wall-clock.h,libgnome-desktop/gnome-xkb-info.h")]
659- public static string[] get_all_languages ();
660- [CCode (array_length = false, array_null_terminated = true, cheader_filename = "libgnome-desktop/gnome-bg-crossfade.h,libgnome-desktop/gnome-bg-slide-show.h,libgnome-desktop/gnome-bg.h,libgnome-desktop/gnome-desktop-thumbnail.h,libgnome-desktop/gnome-idle-monitor.h,libgnome-desktop/gnome-languages.h,libgnome-desktop/gnome-pnp-ids.h,libgnome-desktop/gnome-rr-config.h,libgnome-desktop/gnome-rr.h,libgnome-desktop/gnome-wall-clock.h,libgnome-desktop/gnome-xkb-info.h")]
661- public static string[] get_all_locales ();
662- [CCode (cheader_filename = "libgnome-desktop/gnome-bg-crossfade.h,libgnome-desktop/gnome-bg-slide-show.h,libgnome-desktop/gnome-bg.h,libgnome-desktop/gnome-desktop-thumbnail.h,libgnome-desktop/gnome-idle-monitor.h,libgnome-desktop/gnome-languages.h,libgnome-desktop/gnome-pnp-ids.h,libgnome-desktop/gnome-rr-config.h,libgnome-desktop/gnome-rr.h,libgnome-desktop/gnome-wall-clock.h,libgnome-desktop/gnome-xkb-info.h")]
663- public static string get_country_from_code (string code, string? translation);
664- [CCode (cheader_filename = "libgnome-desktop/gnome-bg-crossfade.h,libgnome-desktop/gnome-bg-slide-show.h,libgnome-desktop/gnome-bg.h,libgnome-desktop/gnome-desktop-thumbnail.h,libgnome-desktop/gnome-idle-monitor.h,libgnome-desktop/gnome-languages.h,libgnome-desktop/gnome-pnp-ids.h,libgnome-desktop/gnome-rr-config.h,libgnome-desktop/gnome-rr.h,libgnome-desktop/gnome-wall-clock.h,libgnome-desktop/gnome-xkb-info.h")]
665- public static string get_country_from_locale (string locale, string? translation);
666- [CCode (cheader_filename = "libgnome-desktop/gnome-bg-crossfade.h,libgnome-desktop/gnome-bg-slide-show.h,libgnome-desktop/gnome-bg.h,libgnome-desktop/gnome-desktop-thumbnail.h,libgnome-desktop/gnome-idle-monitor.h,libgnome-desktop/gnome-languages.h,libgnome-desktop/gnome-pnp-ids.h,libgnome-desktop/gnome-rr-config.h,libgnome-desktop/gnome-rr.h,libgnome-desktop/gnome-wall-clock.h,libgnome-desktop/gnome-xkb-info.h")]
667- public static bool get_input_source_from_locale (string locale, out unowned string type, out unowned string id);
668- [CCode (cheader_filename = "libgnome-desktop/gnome-bg-crossfade.h,libgnome-desktop/gnome-bg-slide-show.h,libgnome-desktop/gnome-bg.h,libgnome-desktop/gnome-desktop-thumbnail.h,libgnome-desktop/gnome-idle-monitor.h,libgnome-desktop/gnome-languages.h,libgnome-desktop/gnome-pnp-ids.h,libgnome-desktop/gnome-rr-config.h,libgnome-desktop/gnome-rr.h,libgnome-desktop/gnome-wall-clock.h,libgnome-desktop/gnome-xkb-info.h")]
669- public static string get_language_from_code (string code, string? translation);
670- [CCode (cheader_filename = "libgnome-desktop/gnome-bg-crossfade.h,libgnome-desktop/gnome-bg-slide-show.h,libgnome-desktop/gnome-bg.h,libgnome-desktop/gnome-desktop-thumbnail.h,libgnome-desktop/gnome-idle-monitor.h,libgnome-desktop/gnome-languages.h,libgnome-desktop/gnome-pnp-ids.h,libgnome-desktop/gnome-rr-config.h,libgnome-desktop/gnome-rr.h,libgnome-desktop/gnome-wall-clock.h,libgnome-desktop/gnome-xkb-info.h")]
671- public static string get_language_from_locale (string locale, string? translation);
672- [CCode (cheader_filename = "libgnome-desktop/gnome-bg-crossfade.h,libgnome-desktop/gnome-bg-slide-show.h,libgnome-desktop/gnome-bg.h,libgnome-desktop/gnome-desktop-thumbnail.h,libgnome-desktop/gnome-idle-monitor.h,libgnome-desktop/gnome-languages.h,libgnome-desktop/gnome-pnp-ids.h,libgnome-desktop/gnome-rr-config.h,libgnome-desktop/gnome-rr.h,libgnome-desktop/gnome-wall-clock.h,libgnome-desktop/gnome-xkb-info.h")]
673- public static bool language_has_translations (string code);
674- [CCode (cheader_filename = "libgnome-desktop/gnome-bg-crossfade.h,libgnome-desktop/gnome-bg-slide-show.h,libgnome-desktop/gnome-bg.h,libgnome-desktop/gnome-desktop-thumbnail.h,libgnome-desktop/gnome-idle-monitor.h,libgnome-desktop/gnome-languages.h,libgnome-desktop/gnome-pnp-ids.h,libgnome-desktop/gnome-rr-config.h,libgnome-desktop/gnome-rr.h,libgnome-desktop/gnome-wall-clock.h,libgnome-desktop/gnome-xkb-info.h")]
675- public static string normalize_locale (string locale);
676- [CCode (cheader_filename = "libgnome-desktop/gnome-bg-crossfade.h,libgnome-desktop/gnome-bg-slide-show.h,libgnome-desktop/gnome-bg.h,libgnome-desktop/gnome-desktop-thumbnail.h,libgnome-desktop/gnome-idle-monitor.h,libgnome-desktop/gnome-languages.h,libgnome-desktop/gnome-pnp-ids.h,libgnome-desktop/gnome-rr-config.h,libgnome-desktop/gnome-rr.h,libgnome-desktop/gnome-wall-clock.h,libgnome-desktop/gnome-xkb-info.h")]
677- public static bool parse_locale (string locale, out string language_codep, out string country_codep, out string codesetp, out string modifierp);
678-}
679
680=== removed file 'deps/pangoft2.vapi'
681--- deps/pangoft2.vapi 2013-06-06 00:45:45 +0000
682+++ deps/pangoft2.vapi 1970-01-01 00:00:00 +0000
683@@ -1,33 +0,0 @@
684-/* pangoft2.vapi generated by vapigen, do not modify. */
685-
686-[CCode (cprefix = "PangoFT2", gir_namespace = "PangoFT2", gir_version = "1.0", lower_case_cprefix = "pango_ft2_")]
687-namespace PangoFT2 {
688- [CCode (cheader_filename = "pango/pangoft2.h", type_id = "pango_ft2_font_map_get_type ()")]
689- public class FontMap : Pango.FontMap {
690- [CCode (has_construct_function = false, type = "PangoFontMap*")]
691- public FontMap ();
692- public void set_default_substitute (owned PangoFT2.SubstituteFunc func);
693- public void set_resolution (double dpi_x, double dpi_y);
694- public void substitute_changed ();
695- }
696- [CCode (cheader_filename = "pango/pangoft2.h", has_target = false)]
697- public delegate void SubstituteFunc (Fc.Pattern pattern, void* data);
698- [CCode (cheader_filename = "pango/pangoft2.h")]
699- public static int font_get_kerning (Pango.Font font, Pango.Glyph left, Pango.Glyph right);
700- [CCode (cheader_filename = "pango/pangoft2.h")]
701- public static Pango.Glyph get_unknown_glyph (Pango.Font font);
702- [CCode (cheader_filename = "pango/pangoft2.h")]
703- public static void render (FT.Bitmap bitmap, Pango.Font font, Pango.GlyphString glyphs, int x, int y);
704- [CCode (cheader_filename = "pango/pangoft2.h")]
705- public static void render_layout (FT.Bitmap bitmap, Pango.Layout layout, int x, int y);
706- [CCode (cheader_filename = "pango/pangoft2.h")]
707- public static void render_layout_line (FT.Bitmap bitmap, Pango.LayoutLine line, int x, int y);
708- [CCode (cheader_filename = "pango/pangoft2.h")]
709- public static void render_layout_line_subpixel (FT.Bitmap bitmap, Pango.LayoutLine line, int x, int y);
710- [CCode (cheader_filename = "pango/pangoft2.h")]
711- public static void render_layout_subpixel (FT.Bitmap bitmap, Pango.Layout layout, int x, int y);
712- [CCode (cheader_filename = "pango/pangoft2.h")]
713- public static void render_transformed (FT.Bitmap bitmap, Pango.Matrix matrix, Pango.Font font, Pango.GlyphString glyphs, int x, int y);
714- [CCode (cheader_filename = "pango/pangoft2.h")]
715- public static void shutdown_display ();
716-}
717
718=== modified file 'lib/Makefile.am'
719--- lib/Makefile.am 2014-06-20 09:58:28 +0000
720+++ lib/Makefile.am 2015-02-19 17:34:10 +0000
721@@ -22,11 +22,12 @@
722 --pkg pangocairo \
723 --pkg gtk+-3.0 \
724 --pkg GDesktopEnums-3.0 \
725- --pkg gnome-desktop-3.0 \
726+ --pkg GnomeDesktop-3.0 \
727 --pkg Xkl-1.0 \
728 --pkg Gkbd-3.0 \
729 --pkg ibus-1.0 \
730- --pkg accountsservice \
731+ --pkg Fcitx-1.0 \
732+ --pkg AccountsService-1.0 \
733 --pkg liblightdm-gobject-1
734 indicator_keyboard_service_CFLAGS = $(AM_CFLAGS) \
735 $(GEE_CFLAGS) \
736@@ -36,6 +37,7 @@
737 $(LIBXKLAVIER_CFLAGS) \
738 $(LIBGNOMEKBD_CFLAGS) \
739 $(IBUS_CFLAGS) \
740+ $(FCITX_GCLIENT_CFLAGS) \
741 $(ACCOUNTSSERVICE_CFLAGS) \
742 $(LIGHTDM_CFLAGS) \
743 $(COVERAGE_CFLAGS)
744@@ -47,6 +49,7 @@
745 $(LIBXKLAVIER_LIBS) \
746 $(LIBGNOMEKBD_LIBS) \
747 $(IBUS_LIBS) \
748+ $(FCITX_GCLIENT_LIBS) \
749 $(ACCOUNTSSERVICE_LIBS) \
750 $(LIGHTDM_LIBS) \
751 $(COVERAGE_LDFLAGS)
752
753=== modified file 'lib/ibus-menu.vala'
754--- lib/ibus-menu.vala 2014-03-26 21:56:42 +0000
755+++ lib/ibus-menu.vala 2015-02-19 17:34:10 +0000
756@@ -128,10 +128,6 @@
757 var state = new Variant.boolean (property.state == IBus.PropState.CHECKED);
758 var action = new SimpleAction.stateful (name, null, state);
759
760- action.activate.connect ((parameter) => {
761- action.change_state (new Variant.boolean (!action.get_state ().get_boolean ()));
762- });
763-
764 action.change_state.connect ((value) => {
765 if (value != null) {
766 action.set_state ((!) value);
767@@ -154,26 +150,26 @@
768 /* Create a single action for all radio properties. */
769 if (action_map != null && radio_name == null) {
770 radio_counter++;
771- radio_name = @"-private-radio-$radio_counter";
772- radio_action = new SimpleAction.stateful ((!) radio_name, VariantType.STRING, new Variant.string (""));
773-
774- ((!) radio_action).activate.connect ((parameter) => {
775- ((!) radio_action).change_state (parameter);
776- });
777-
778- ((!) radio_action).change_state.connect ((value) => {
779+
780+ var name = @"-private-radio-$radio_counter";
781+ var action = new SimpleAction.stateful (name, VariantType.STRING, new Variant.string (""));
782+
783+ action.change_state.connect ((value) => {
784 if (value != null) {
785 var key = ((!) value).get_string ();
786
787 if (radio_properties.has_key (key)) {
788- ((!) radio_action).set_state ((!) value);
789+ action.set_state ((!) value);
790 activate (radio_properties[key], IBus.PropState.CHECKED);
791 }
792 }
793 });
794
795- ((!) action_map).add_action ((!) radio_action);
796- names.add ((!) radio_name);
797+ ((!) action_map).add_action (action);
798+ names.add (name);
799+
800+ radio_name = name;
801+ radio_action = action;
802 }
803
804 radio_properties[property.key] = property;
805@@ -195,7 +191,7 @@
806
807 private void append_menu_property (IBus.Property property) {
808 if (property.prop_type == IBus.PropType.MENU) {
809- var submenu = new IBusMenu (action_map, ((!) property).sub_props);
810+ var submenu = new IBusMenu (action_map, property.sub_props);
811 submenu.activate.connect ((property, state) => { activate (property, state); });
812 menu.append_submenu (get_label (property), submenu);
813 }
814@@ -295,7 +291,7 @@
815 return menu.get_item_link (item_index, link);
816 }
817
818- public override void get_item_links (int item_index, out HashTable<string, MenuModel>? links) {
819+ public override void get_item_links (int item_index, out HashTable<string, MenuModel> links) {
820 menu.get_item_links (item_index, out links);
821 }
822
823
824=== modified file 'lib/indicator-menu.vala'
825--- lib/indicator-menu.vala 2014-04-09 23:28:03 +0000
826+++ lib/indicator-menu.vala 2015-02-19 17:34:10 +0000
827@@ -19,10 +19,11 @@
828 public class Indicator.Keyboard.IndicatorMenu : MenuModel {
829
830 public enum Options {
831- NONE = 0x0,
832- DCONF = 0x1,
833- IBUS = 0x2,
834- SETTINGS = 0x4
835+ NONE = 0,
836+ DCONF = 1 << 0,
837+ XKB = 1 << 1,
838+ IBUS = 1 << 2,
839+ SETTINGS = 1 << 3
840 }
841
842 private Options options;
843@@ -32,42 +33,45 @@
844 private IBusMenu properties_section;
845
846 public IndicatorMenu (ActionMap? action_map = null, Options options = Options.NONE) {
847- var submenu = new Menu ();
848+ this.options = options;
849
850+ indicator_menu = new Menu ();
851 sources_section = new Menu ();
852- submenu.append_section (null, sources_section);
853-
854- if ((options & Options.IBUS) != Options.NONE) {
855- properties_section = new IBusMenu (action_map);
856- properties_section.activate.connect ((property, state) => { activate (property, state); });
857- submenu.append_section (null, properties_section);
858- }
859-
860- if ((options & Options.SETTINGS) != Options.NONE) {
861- var settings_section = new Menu ();
862- settings_section.append (_ ("Character Map"), "indicator.map");
863- settings_section.append (_ ("Keyboard Layout Chart"), "indicator.chart");
864- settings_section.append (_ ("Text Entry Settings..."), "indicator.settings");
865- submenu.append_section (null, settings_section);
866- }
867-
868- var indicator = new MenuItem.submenu (null, submenu);
869- indicator.set_detailed_action ("indicator.indicator");
870- indicator.set_attribute ("x-canonical-type", "s", "com.canonical.indicator.root");
871-
872- /* We need special mouse actions on the lock screen. */
873- if ((options & Options.DCONF) != Options.NONE) {
874- indicator.set_attribute ("x-canonical-secondary-action", "s", "indicator.next");
875- indicator.set_attribute ("x-canonical-scroll-action", "s", "indicator.scroll");
876- } else {
877- indicator.set_attribute ("x-canonical-secondary-action", "s", "indicator.locked_next");
878- indicator.set_attribute ("x-canonical-scroll-action", "s", "indicator.locked_scroll");
879- }
880-
881- indicator_menu = new Menu ();
882- indicator_menu.append_item (indicator);
883-
884- this.options = options;
885+
886+ if ((options & ~Options.DCONF) != Options.NONE) {
887+ var submenu = new Menu ();
888+
889+ submenu.append_section (null, sources_section);
890+
891+ if (Options.IBUS in options) {
892+ properties_section = new IBusMenu (action_map);
893+ properties_section.activate.connect ((property, state) => { activate (property, state); });
894+ submenu.append_section (null, properties_section);
895+ }
896+
897+ if (Options.SETTINGS in options) {
898+ var settings_section = new Menu ();
899+ settings_section.append (_ ("Character Map"), "indicator.map");
900+ settings_section.append (_ ("Keyboard Layout Chart"), "indicator.chart");
901+ settings_section.append (_ ("Text Entry Settings..."), "indicator.settings");
902+ submenu.append_section (null, settings_section);
903+ }
904+
905+ var indicator = new MenuItem.submenu (null, submenu);
906+ indicator.set_detailed_action ("indicator.indicator");
907+ indicator.set_attribute ("x-canonical-type", "s", "com.canonical.indicator.root");
908+
909+ /* We need special mouse actions on the lock screen. */
910+ if (Options.DCONF in options) {
911+ indicator.set_attribute ("x-canonical-secondary-action", "s", "indicator.next");
912+ indicator.set_attribute ("x-canonical-scroll-action", "s", "indicator.scroll");
913+ } else {
914+ indicator.set_attribute ("x-canonical-secondary-action", "s", "indicator.locked_next");
915+ indicator.set_attribute ("x-canonical-scroll-action", "s", "indicator.locked_scroll");
916+ }
917+
918+ indicator_menu.append_item (indicator);
919+ }
920 }
921
922 public signal void activate (IBus.Property property, IBus.PropState state);
923@@ -76,10 +80,13 @@
924 sources_section.remove_all ();
925
926 for (var i = 0; i < sources.length; i++) {
927- if (!sources[i].is_ibus || (options & Options.IBUS) != Options.NONE) {
928+ var visible = (sources[i].is_xkb && Options.XKB in options) ||
929+ (sources[i].is_ibus && Options.IBUS in options);
930+
931+ if (visible) {
932 string action;
933
934- if ((options & Options.DCONF) != Options.NONE) {
935+ if (Options.DCONF in options) {
936 action = "indicator.current";
937 } else {
938 action = "indicator.active";
939@@ -99,13 +106,13 @@
940 }
941
942 public void set_properties (IBus.PropList properties) {
943- if ((options & Options.IBUS) != Options.NONE) {
944+ if (Options.IBUS in options) {
945 properties_section.set_properties (properties);
946 }
947 }
948
949 public void update_property (IBus.Property property) {
950- if ((options & Options.IBUS) != Options.NONE) {
951+ if (Options.IBUS in options) {
952 properties_section.update_property (property);
953 }
954 }
955@@ -122,7 +129,7 @@
956 indicator_menu.get_item_attributes (item_index, out attributes);
957 }
958
959- public override void get_item_links (int item_index, out HashTable<string, MenuModel>? links) {
960+ public override void get_item_links (int item_index, out HashTable<string, MenuModel> links) {
961 indicator_menu.get_item_links (item_index, out links);
962 }
963
964
965=== modified file 'lib/main.vala'
966--- lib/main.vala 2014-06-18 13:23:59 +0000
967+++ lib/main.vala 2015-02-19 17:34:10 +0000
968@@ -33,7 +33,7 @@
969 private SList<Act.User> users;
970
971 private WindowStack? window_stack;
972- private Gee.HashMap<uint, uint>? window_sources;
973+ private Gee.HashMap<uint, Source>? window_sources;
974 private uint focused_window_id;
975
976 private IBus.Bus? ibus;
977@@ -41,6 +41,9 @@
978 private ulong ibus_connected_id;
979 private uint panel_timeout;
980
981+ private Fcitx.InputMethod? fcitx;
982+ private bool fcitx_initialized;
983+
984 private Source[]? sources;
985
986 private SimpleActionGroup? action_group;
987@@ -118,11 +121,13 @@
988 handle_unity_name_appeared,
989 handle_unity_name_vanished);
990
991- Bus.watch_name (BusType.SESSION,
992- "com.canonical.Unity.WindowStack",
993- BusNameWatcherFlags.NONE,
994- handle_window_stack_name_appeared,
995- handle_window_stack_name_vanished);
996+ if (!is_fcitx_active ()) {
997+ Bus.watch_name (BusType.SESSION,
998+ "com.canonical.Unity.WindowStack",
999+ BusNameWatcherFlags.NONE,
1000+ handle_window_stack_name_appeared,
1001+ handle_window_stack_name_vanished);
1002+ }
1003 }
1004
1005 indicator_settings = new Settings ("com.canonical.indicator.keyboard");
1006@@ -146,11 +151,33 @@
1007 }
1008
1009 [DBus (visible = false)]
1010+ private static bool is_ibus_active () {
1011+ if (is_login_user ()) {
1012+ return false;
1013+ }
1014+
1015+ var module = Environment.get_variable ("GTK_IM_MODULE");
1016+ return module != null && (!) module == "ibus";
1017+ }
1018+
1019+ [DBus (visible = false)]
1020+ private static bool is_fcitx_active () {
1021+ if (is_login_user ()) {
1022+ return false;
1023+ }
1024+
1025+ var module = Environment.get_variable ("GTK_IM_MODULE");
1026+ return module != null && (!) module == "fcitx";
1027+ }
1028+
1029+ [DBus (visible = false)]
1030 private IBus.Bus get_ibus () {
1031 if (ibus == null) {
1032 IBus.init ();
1033- ibus = new IBus.Bus ();
1034- ((!) ibus).connected.connect (() => {
1035+
1036+ var proxy = new IBus.Bus ();
1037+
1038+ proxy.connected.connect (() => {
1039 if (desktop_menu != null) {
1040 get_desktop_menu ().set_sources (get_sources ());
1041 }
1042@@ -167,6 +194,8 @@
1043 update_indicator_action ();
1044 }
1045 });
1046+
1047+ ibus = proxy;
1048 }
1049
1050 return (!) ibus;
1051@@ -180,9 +209,9 @@
1052 var path = "/org/freedesktop/IBus/Panel";
1053
1054 try {
1055- ibus_panel = connection.get_proxy_sync (name, path);
1056+ var proxy = connection.get_proxy_sync<IBusPanel> (name, path);
1057
1058- ((!) ibus_panel).properties_registered.connect ((variant) => {
1059+ proxy.properties_registered.connect ((variant) => {
1060 var properties = new IBus.PropList ();
1061 properties.deserialize (variant);
1062
1063@@ -190,7 +219,7 @@
1064 handle_properties_registered ((!) (properties as IBus.PropList));
1065 }
1066 });
1067- ((!) ibus_panel).property_updated.connect ((variant) => {
1068+ proxy.property_updated.connect ((variant) => {
1069 var type = IBus.PropType.NORMAL;
1070 var state = IBus.PropState.INCONSISTENT;
1071 var text = new IBus.Text.from_static_string ("");
1072@@ -201,6 +230,8 @@
1073 handle_property_updated ((!) (property as IBus.Property));
1074 }
1075 });
1076+
1077+ ibus_panel = proxy;
1078 } catch (IOError error) {
1079 warning ("error: %s", error.message);
1080 }
1081@@ -210,10 +241,30 @@
1082 }
1083
1084 [DBus (visible = false)]
1085+ private Fcitx.InputMethod? get_fcitx () {
1086+ if (!fcitx_initialized) {
1087+ fcitx_initialized = true;
1088+
1089+ if (is_fcitx_active ()) {
1090+ try {
1091+ var proxy = new Fcitx.InputMethod (BusType.SESSION, DBusProxyFlags.NONE, 0);
1092+ proxy.notify["current-im"].connect ((pspec) => { handle_changed_current ("current"); });
1093+ fcitx = proxy;
1094+ } catch (Error error) {
1095+ warning ("error: %s", error.message);
1096+ }
1097+ }
1098+ }
1099+
1100+ return fcitx;
1101+ }
1102+
1103+ [DBus (visible = false)]
1104 public void up () {
1105 if (loop == null) {
1106- loop = new MainLoop ();
1107- ((!) loop).run ();
1108+ var main_loop = new MainLoop ();
1109+ loop = main_loop;
1110+ main_loop.run ();
1111 }
1112 }
1113
1114@@ -254,17 +305,13 @@
1115 Act.User? user = manager.get_user ((!) greeter_user);
1116
1117 if (user != null && ((!) user).is_loaded) {
1118- VariantIter outer;
1119- VariantIter inner;
1120-
1121- var sources = ((!) user).input_sources;
1122- sources.get ("aa{ss}", out outer);
1123-
1124- while (outer.next ("a{ss}", out inner)) {
1125- unowned string key;
1126- unowned string value;
1127-
1128- while (inner.next ("{&s&s}", out key, out value)) {
1129+ foreach (var outer in ((!) user).input_sources) {
1130+ foreach (var inner in (!) outer) {
1131+ unowned string key;
1132+ unowned string value;
1133+
1134+ ((!) inner).get ("{&s&s}", out key, out value);
1135+
1136 if (key == "xkb") {
1137 source = value;
1138 break;
1139@@ -289,9 +336,7 @@
1140 }
1141
1142 if (layouts.length > 0) {
1143- source = layouts[0];
1144- source = ((!) source).replace (" ", "+");
1145- source = ((!) source).replace ("\t", "+");
1146+ source = layouts[0].replace (" ", "+").replace ("\t", "+");
1147 }
1148 }
1149 }
1150@@ -340,7 +385,7 @@
1151 [DBus (visible = false)]
1152 private void migrate_keyboard_layouts () {
1153 if (is_login_user ()) {
1154- lightdm_current = source_settings.get_uint ("current");
1155+ lightdm_current = get_current ();
1156
1157 var manager = Act.UserManager.get_default ();
1158
1159@@ -450,17 +495,13 @@
1160 if (user.is_loaded) {
1161 var done = false;
1162
1163- VariantIter outer;
1164- VariantIter inner;
1165-
1166- var sources = user.input_sources;
1167- sources.get ("aa{ss}", out outer);
1168-
1169- while (outer.next ("a{ss}", out inner)) {
1170- unowned string key;
1171- unowned string source;
1172-
1173- while (inner.next ("{&s&s}", out key, out source)) {
1174+ foreach (var outer in user.input_sources) {
1175+ foreach (var inner in (!) outer) {
1176+ unowned string key;
1177+ unowned string source;
1178+
1179+ ((!) inner).get ("{&s&s}", out key, out source);
1180+
1181 if (key == "xkb") {
1182 done = true;
1183
1184@@ -548,7 +589,7 @@
1185 private void update_login_layout () {
1186 if (is_login_user ()) {
1187 unowned List<LightDM.Layout> layouts = LightDM.get_layouts ();
1188- var current = source_settings.get_uint ("current");
1189+ var current = get_current ();
1190
1191 if (current < get_sources ().length) {
1192 var source = get_sources ()[current];
1193@@ -594,10 +635,12 @@
1194 warning ("error: %s", error.message);
1195 }
1196
1197- window_sources = new Gee.HashMap<uint, uint> ();
1198+ window_sources = new Gee.HashMap<uint, Source> ();
1199+ ((!) window_stack).window_destroyed.connect (handle_window_destroyed);
1200 ((!) window_stack).focused_window_changed.connect (handle_focused_window_changed);
1201 } else {
1202 ((!) window_stack).focused_window_changed.disconnect (handle_focused_window_changed);
1203+ ((!) window_stack).window_destroyed.disconnect (handle_window_destroyed);
1204 window_sources = null;
1205 }
1206 }
1207@@ -610,22 +653,49 @@
1208 }
1209
1210 [DBus (visible = false)]
1211+ private void handle_window_destroyed (uint window_id, string app_id) {
1212+ ((!) window_sources).unset (window_id);
1213+ }
1214+
1215+ [DBus (visible = false)]
1216 private void handle_focused_window_changed (uint window_id, string app_id, uint stage) {
1217- var old_current = source_settings.get_uint ("current");
1218+ var sources = get_sources ();
1219+ var old_current = get_current ();
1220
1221- ((!) window_sources)[focused_window_id] = old_current;
1222+ if (old_current < sources.length) {
1223+ ((!) window_sources)[focused_window_id] = sources[old_current];
1224+ }
1225
1226 if (!(((!) window_sources).has_key (window_id))) {
1227 var default_group = per_window_settings.get_int ("default-group");
1228
1229- if (default_group >= 0 && default_group != old_current) {
1230- source_settings.set_uint ("current", (uint) default_group);
1231+ if (default_group >= 0) {
1232+ for (var offset = 0; offset < sources.length; offset++) {
1233+ var current = (default_group + offset) % sources.length;
1234+ var source = sources[current];
1235+
1236+ if (source.is_xkb ||
1237+ (source.is_ibus && is_ibus_active ()) ||
1238+ (source.is_fcitx && is_fcitx_active ())) {
1239+ if (current != old_current) {
1240+ source_settings.set_uint ("current", current);
1241+ }
1242+
1243+ break;
1244+ }
1245+ }
1246 }
1247 } else {
1248- var current = ((!) window_sources)[window_id];
1249-
1250- if (current != old_current) {
1251- source_settings.set_uint ("current", current);
1252+ var source = ((!) window_sources)[window_id];
1253+
1254+ for (var current = 0; current < sources.length; current++) {
1255+ if (sources[current] == source) {
1256+ if (current != old_current) {
1257+ source_settings.set_uint ("current", current);
1258+ }
1259+
1260+ break;
1261+ }
1262 }
1263 }
1264
1265@@ -633,6 +703,44 @@
1266 }
1267
1268 [DBus (visible = false)]
1269+ private uint get_current () {
1270+ if (is_fcitx_active () && get_fcitx () != null) {
1271+ string? engine = ((!) get_fcitx ()).current_im;
1272+
1273+ if (engine != null) {
1274+ var is_xkb = ((!) engine).has_prefix ("fcitx-keyboard-");
1275+ var type = is_xkb ? "xkb" : "fcitx";
1276+ var name = (!) engine;
1277+
1278+ if (is_xkb) {
1279+ name = name.substring ("fcitx-keyboard-".length);
1280+ var index = name.index_of ("-");
1281+ if (index >= 0) {
1282+ name.data[index] = '+';
1283+ }
1284+ }
1285+
1286+ var i = 0;
1287+
1288+ foreach (var pair in source_settings.get_value ("sources")) {
1289+ unowned string source_type;
1290+ unowned string source_name;
1291+
1292+ ((!) pair).get ("(&s&s)", out source_type, out source_name);
1293+
1294+ if (source_name == name && source_type == type) {
1295+ return i;
1296+ }
1297+
1298+ i++;
1299+ }
1300+ }
1301+ }
1302+
1303+ return source_settings.get_uint ("current");
1304+ }
1305+
1306+ [DBus (visible = false)]
1307 private Source[] get_sources () {
1308 if (sources == null) {
1309 var array = source_settings.get_value ("sources");
1310@@ -743,7 +851,7 @@
1311 [DBus (visible = false)]
1312 private void update_active_action () {
1313 if (active_action != null) {
1314- ((!) active_action).set_state (source_settings.get_value ("current"));
1315+ ((!) active_action).set_state (new Variant.uint32 (get_current ()));
1316 update_indicator_action ();
1317 }
1318 }
1319@@ -751,10 +859,9 @@
1320 [DBus (visible = false)]
1321 private Action get_active_action () {
1322 if (active_action == null) {
1323- var current = source_settings.get_value ("current");
1324- active_action = new SimpleAction.stateful ("active", VariantType.UINT32, current);
1325- ((!) active_action).activate.connect ((parameter) => { ((!) active_action).change_state (parameter); });
1326- ((!) active_action).change_state.connect (handle_changed_active);
1327+ var action = new SimpleAction.stateful ("active", VariantType.UINT32, new Variant.uint32 (get_current ()));
1328+ action.change_state.connect (handle_changed_active);
1329+ active_action = action;
1330 }
1331
1332 return (!) active_action;
1333@@ -768,13 +875,45 @@
1334 [DBus (visible = false)]
1335 private void handle_scroll_wheel (Variant? parameter) {
1336 if (parameter != null) {
1337- var sources = source_settings.get_value ("sources");
1338- var current = source_settings.get_uint ("current");
1339- var length = (int) sources.n_children ();
1340-
1341- if (length > 0) {
1342- var offset = ((!) parameter).get_int32 () % length;
1343- source_settings.set_uint ("current", (current + (length - offset)) % length);
1344+ var old_current = get_current ();
1345+ var sources = get_sources ();
1346+ var length = 0;
1347+
1348+ foreach (var source in sources) {
1349+ if (source.is_xkb ||
1350+ (source.is_ibus && is_ibus_active ()) ||
1351+ (source.is_fcitx && is_fcitx_active ())) {
1352+ length++;
1353+ }
1354+ }
1355+
1356+ if (length > 1) {
1357+ var current = old_current;
1358+ var offset = -((!) parameter).get_int32 () % length;
1359+ var jump = 1;
1360+
1361+ if (offset < 0) {
1362+ offset = -offset;
1363+ jump = sources.length - jump;
1364+ }
1365+
1366+ /*
1367+ * We need to cycle through offset valid input sources, skipping those that aren't
1368+ * valid for this session (i.e. skipping Fcitx ones if IBus is active and vice-versa.
1369+ * jump is the direction we need to cycle in, which is 1 if we want to cycle forward
1370+ * and -1 (mod sources.length) if we want to cycle backward.
1371+ */
1372+
1373+ for (; offset > 0; offset--) {
1374+ do {
1375+ current = (current + jump) % sources.length;
1376+ } while ((sources[current].is_ibus && !is_ibus_active ()) ||
1377+ (sources[current].is_fcitx && !is_fcitx_active ()));
1378+ }
1379+
1380+ if (current != old_current) {
1381+ source_settings.set_uint ("current", current);
1382+ }
1383 }
1384 }
1385 }
1386@@ -788,30 +927,30 @@
1387 private void handle_scroll_wheel_when_locked (Variant? parameter) {
1388 if (parameter != null) {
1389 var sources = get_sources ();
1390- var non_ibus_length = 0;
1391+ var xkb_length = 0;
1392
1393- /* Figure out how many non-IBus sources we have. */
1394+ /* Figure out how many Xkb sources we have. */
1395 foreach (var source in sources) {
1396- if (!source.is_ibus) {
1397- non_ibus_length++;
1398+ if (source.is_xkb) {
1399+ xkb_length++;
1400 }
1401 }
1402
1403- if (non_ibus_length > 1) {
1404+ if (xkb_length > 1) {
1405 var active_action = get_active_action ();
1406 var active = active_action.get_state ().get_uint32 ();
1407- var offset = -((!) parameter).get_int32 () % non_ibus_length;
1408+ var offset = -((!) parameter).get_int32 () % xkb_length;
1409
1410- /* Make offset positive modulo non_ibus_length. */
1411+ /* Make offset positive modulo xkb_length. */
1412 if (offset < 0) {
1413- offset += non_ibus_length;
1414+ offset += xkb_length;
1415 }
1416
1417- /* We need to cycle through non-IBus sources only. */
1418+ /* We need to cycle through Xkb sources only. */
1419 while (offset > 0) {
1420 do {
1421 active = (active + 1) % sources.length;
1422- } while (sources[active].is_ibus);
1423+ } while (!sources[active].is_xkb);
1424
1425 offset--;
1426 }
1427@@ -881,13 +1020,20 @@
1428 [DBus (visible = false)]
1429 public IndicatorMenu get_desktop_menu () {
1430 if (desktop_menu == null) {
1431- var options = IndicatorMenu.Options.DCONF
1432- | IndicatorMenu.Options.IBUS
1433- | IndicatorMenu.Options.SETTINGS;
1434-
1435- desktop_menu = new IndicatorMenu (get_action_group (), options);
1436- ((!) desktop_menu).set_sources (get_sources ());
1437- ((!) desktop_menu).activate.connect ((property, state) => {
1438+ var options = IndicatorMenu.Options.DCONF;
1439+
1440+ if (!is_fcitx_active ()) {
1441+ options |= IndicatorMenu.Options.XKB | IndicatorMenu.Options.SETTINGS;
1442+
1443+ if (is_ibus_active ()) {
1444+ options |= IndicatorMenu.Options.IBUS;
1445+ }
1446+ }
1447+
1448+ var menu = new IndicatorMenu (get_action_group (), options);
1449+
1450+ menu.set_sources (get_sources ());
1451+ menu.activate.connect ((property, state) => {
1452 var panel = get_ibus_panel ();
1453
1454 if (panel != null) {
1455@@ -898,6 +1044,8 @@
1456 }
1457 }
1458 });
1459+
1460+ desktop_menu = menu;
1461 }
1462
1463 return (!) desktop_menu;
1464@@ -906,10 +1054,12 @@
1465 [DBus (visible = false)]
1466 public IndicatorMenu get_desktop_greeter_menu () {
1467 if (desktop_greeter_menu == null) {
1468- var options = IndicatorMenu.Options.DCONF;
1469+ var options = IndicatorMenu.Options.DCONF |
1470+ IndicatorMenu.Options.XKB;
1471
1472- desktop_greeter_menu = new IndicatorMenu (get_action_group (), options);
1473- ((!) desktop_greeter_menu).set_sources (get_sources ());
1474+ var menu = new IndicatorMenu (get_action_group (), options);
1475+ menu.set_sources (get_sources ());
1476+ desktop_greeter_menu = menu;
1477 }
1478
1479 return (!) desktop_greeter_menu;
1480@@ -918,10 +1068,11 @@
1481 [DBus (visible = false)]
1482 public IndicatorMenu get_desktop_lockscreen_menu () {
1483 if (desktop_lockscreen_menu == null) {
1484- var options = IndicatorMenu.Options.NONE;
1485+ var options = IndicatorMenu.Options.XKB;
1486
1487- desktop_lockscreen_menu = new IndicatorMenu (get_action_group (), options);
1488- ((!) desktop_lockscreen_menu).set_sources (get_sources ());
1489+ var menu = new IndicatorMenu (get_action_group (), options);
1490+ menu.set_sources (get_sources ());
1491+ desktop_lockscreen_menu = menu;
1492 }
1493
1494 return (!) desktop_lockscreen_menu;
1495@@ -965,7 +1116,7 @@
1496 string? variant = null;
1497
1498 var sources = get_sources ();
1499- var current = source_settings.get_uint ("current");
1500+ var current = get_current ();
1501
1502 if (current < sources.length) {
1503 layout = sources[current].layout;
1504@@ -1004,8 +1155,9 @@
1505 [DBus (visible = false)]
1506 private void handle_unity_greeter_name_appeared (DBusConnection connection, string name, string name_owner) {
1507 try {
1508- unity_greeter = Bus.get_proxy_sync (BusType.SESSION, name, "/list");
1509- ((!) unity_greeter).entry_selected.connect (handle_entry_selected);
1510+ var greeter = Bus.get_proxy_sync<UnityGreeter> (BusType.SESSION, name, "/list");
1511+ greeter.entry_selected.connect (handle_entry_selected);
1512+ unity_greeter = greeter;
1513 } catch (IOError error) {
1514 warning ("error: %s", error.message);
1515 }
1516@@ -1033,16 +1185,17 @@
1517 [DBus (visible = false)]
1518 private void handle_unity_name_appeared (DBusConnection connection, string name, string name_owner) {
1519 try {
1520- unity_session = Bus.get_proxy_sync (BusType.SESSION, name, "/com/canonical/Unity/Session");
1521- ((!) unity_session).locked.connect (() => {
1522+ var session = Bus.get_proxy_sync<UnitySession> (BusType.SESSION, name, "/com/canonical/Unity/Session");
1523+
1524+ session.locked.connect (() => {
1525 var sources = get_sources ();
1526
1527 if (sources.length > 0) {
1528- var current = source_settings.get_uint ("current");
1529+ var current = get_current ();
1530
1531- if (current < sources.length && sources[current].is_ibus) {
1532+ if (current < sources.length && !sources[current].is_xkb) {
1533 for (var i = 0; i < sources.length; i++) {
1534- if (!sources[i].is_ibus) {
1535+ if (sources[i].is_xkb) {
1536 get_active_action ().change_state (new Variant.uint32 (i));
1537 break;
1538 }
1539@@ -1050,9 +1203,11 @@
1540 }
1541 }
1542 });
1543- ((!) unity_session).unlocked.connect (() => {
1544- get_active_action ().change_state (source_settings.get_value ("current"));
1545+ session.unlocked.connect (() => {
1546+ get_active_action ().change_state (new Variant.uint32 (get_current ()));
1547 });
1548+
1549+ unity_session = session;
1550 } catch (IOError error) {
1551 warning ("error: %s", error.message);
1552 }
1553
1554=== modified file 'lib/source.vala'
1555--- lib/source.vala 2014-02-26 18:24:23 +0000
1556+++ lib/source.vala 2015-02-19 17:34:10 +0000
1557@@ -19,10 +19,12 @@
1558 public class Indicator.Keyboard.Source : Object {
1559
1560 private static Gnome.XkbInfo? xkb_info;
1561- private static IBus.Bus? bus;
1562+ private static IBus.Bus? ibus_bus;
1563+ private static Fcitx.InputMethod? fcitx_proxy;
1564
1565 private string? xkb;
1566 private string? ibus;
1567+ private string? fcitx;
1568
1569 private string? _name;
1570 private string? _short_name;
1571@@ -77,6 +79,10 @@
1572 get { return ibus != null; }
1573 }
1574
1575+ public bool is_fcitx {
1576+ get { return fcitx != null; }
1577+ }
1578+
1579 public Source (Variant variant, bool use_gtk = false) {
1580 Object (use_gtk: use_gtk);
1581
1582@@ -90,19 +96,22 @@
1583 xkb = name;
1584 } else if (type == "ibus") {
1585 ibus = name;
1586+ } else if (type == "fcitx") {
1587+ fcitx = name;
1588 }
1589 } else if (variant.is_of_type (new VariantType ("a{ss}"))) {
1590- VariantIter iter;
1591- unowned string key;
1592- unowned string value;
1593-
1594- variant.get ("a{ss}", out iter);
1595-
1596- while (iter.next ("{&s&s}", out key, out value)) {
1597+ foreach (var pair in variant) {
1598+ unowned string key;
1599+ unowned string value;
1600+
1601+ ((!) pair).get ("{&s&s}", out key, out value);
1602+
1603 if (key == "xkb") {
1604 xkb = value;
1605 } else if (key == "ibus") {
1606 ibus = value;
1607+ } else if (key == "fcitx") {
1608+ fcitx = value;
1609 }
1610 }
1611 }
1612@@ -116,13 +125,21 @@
1613 return (!) xkb_info;
1614 }
1615
1616- private static IBus.Bus get_bus () {
1617- if (bus == null) {
1618+ private static IBus.Bus get_ibus_bus () {
1619+ if (ibus_bus == null) {
1620 IBus.init ();
1621- bus = new IBus.Bus ();
1622- }
1623-
1624- return (!) bus;
1625+ ibus_bus = new IBus.Bus ();
1626+ }
1627+
1628+ return (!) ibus_bus;
1629+ }
1630+
1631+ private static Fcitx.InputMethod get_fcitx_proxy () throws Error {
1632+ if (fcitx_proxy == null) {
1633+ fcitx_proxy = new Fcitx.InputMethod (BusType.SESSION, DBusProxyFlags.NONE, 0);
1634+ }
1635+
1636+ return (!) fcitx_proxy;
1637 }
1638
1639 private IBus.EngineDesc? get_engine () {
1640@@ -132,7 +149,7 @@
1641 var names = new string[2];
1642 names[0] = (!) ibus;
1643
1644- var engines = get_bus ().get_engines_by_names (names);
1645+ var engines = get_ibus_bus ().get_engines_by_names (names);
1646
1647 if (engines.length > 0) {
1648 engine = engines[0];
1649@@ -145,31 +162,7 @@
1650 protected virtual string? _get_name () {
1651 string? name = null;
1652
1653- var engine = get_engine ();
1654-
1655- if (engine != null) {
1656- string? language = ((!) engine).get_language ();
1657- string? display_name = ((!) engine).get_longname ();
1658- var has_language = language != null && ((!) language).get_char () != '\0';
1659- var has_display_name = display_name != null && ((!) display_name).get_char () != '\0';
1660-
1661- if (has_language) {
1662- language = Xkl.get_language_name ((!) language);
1663- has_language = language != null && ((!) language).get_char () != '\0';
1664- }
1665-
1666- if (has_language && has_display_name) {
1667- name = @"$((!) language) ($((!) display_name))";
1668- } else if (has_language) {
1669- name = language;
1670- } else if (has_display_name) {
1671- name = display_name;
1672- }
1673- }
1674-
1675- var has_name = name != null && ((!) name).get_char () != '\0';
1676-
1677- if (!has_name && xkb != null) {
1678+ if (xkb != null) {
1679 string? display_name = null;
1680 string? layout = null;
1681
1682@@ -194,13 +187,52 @@
1683 name = country;
1684 }
1685 }
1686- }
1687-
1688- if (name == null || ((!) name).get_char () == '\0') {
1689- if (ibus != null) {
1690+
1691+ if (name == null || ((!) name).get_char () == '\0') {
1692+ name = xkb;
1693+ }
1694+ } else if (ibus != null) {
1695+ var engine = get_engine ();
1696+
1697+ if (engine != null) {
1698+ string? language = ((!) engine).get_language ();
1699+ string? display_name = ((!) engine).get_longname ();
1700+ var has_language = language != null && ((!) language).get_char () != '\0';
1701+ var has_display_name = display_name != null && ((!) display_name).get_char () != '\0';
1702+
1703+ if (has_language) {
1704+ language = Xkl.get_language_name ((!) language);
1705+ has_language = language != null && ((!) language).get_char () != '\0';
1706+ }
1707+
1708+ if (has_language && has_display_name) {
1709+ name = @"$((!) language) ($((!) display_name))";
1710+ } else if (has_language) {
1711+ name = language;
1712+ } else if (has_display_name) {
1713+ name = display_name;
1714+ }
1715+ }
1716+
1717+ if (name == null || ((!) name).get_char () == '\0') {
1718 name = ibus;
1719- } else if (xkb != null) {
1720- name = xkb;
1721+ }
1722+ } else if (fcitx != null) {
1723+ try {
1724+ var input_methods = get_fcitx_proxy ().get_imlist_nofree ();
1725+
1726+ for (var i = 0; i < input_methods.length; i++) {
1727+ if (input_methods.get (i).unique_name == (!) fcitx) {
1728+ name = input_methods.get (i).name;
1729+ break;
1730+ }
1731+ }
1732+ } catch (Error error) {
1733+ warning ("error: %s", error.message);
1734+ }
1735+
1736+ if (name == null || ((!) name).get_char () == '\0') {
1737+ name = fcitx;
1738 }
1739 }
1740
1741@@ -212,23 +244,36 @@
1742
1743 if (xkb != null) {
1744 get_xkb_info ().get_layout_info ((!) xkb, null, out short_name, null, null);
1745- }
1746-
1747- var has_short_name = short_name != null && ((!) short_name).get_char () != '\0';
1748-
1749- if (!has_short_name) {
1750+
1751+ if (short_name == null || ((!) short_name).get_char () == '\0') {
1752+ short_name = xkb;
1753+ }
1754+ } else if (ibus != null) {
1755 var engine = get_engine ();
1756
1757 if (engine != null) {
1758 short_name = ((!) engine).get_name ();
1759 }
1760- }
1761
1762- if (short_name == null || ((!) short_name).get_char () == '\0') {
1763- if (ibus != null) {
1764+ if (short_name == null || ((!) short_name).get_char () == '\0') {
1765 short_name = ibus;
1766- } else if (xkb != null) {
1767- short_name = xkb;
1768+ }
1769+ } else if (fcitx != null) {
1770+ try {
1771+ var input_methods = get_fcitx_proxy ().get_imlist_nofree ();
1772+
1773+ for (var i = 0; i < input_methods.length; i++) {
1774+ if (input_methods.get (i).unique_name == (!) fcitx) {
1775+ short_name = input_methods.get (i).langcode;
1776+ break;
1777+ }
1778+ }
1779+ } catch (Error error) {
1780+ warning ("error: %s", error.message);
1781+ }
1782+
1783+ if (short_name == null || ((!) short_name).get_char () == '\0') {
1784+ short_name = fcitx;
1785 }
1786 }
1787
1788@@ -290,12 +335,14 @@
1789 Gdk.Screen? screen = Gdk.Screen.get_default ();
1790
1791 if (screen != null) {
1792- context = new Gtk.StyleContext ();
1793- ((!) context).set_screen ((!) screen);
1794+ var style_context = new Gtk.StyleContext ();
1795+ style_context.set_screen ((!) screen);
1796
1797 var path = new Gtk.WidgetPath ();
1798 path.append_type (typeof (Gtk.MenuItem));
1799- ((!) context).set_path (path);
1800+ style_context.set_path (path);
1801+
1802+ context = style_context;
1803 }
1804 }
1805
1806
1807=== modified file 'tests/indicator-keyboard-test.in'
1808--- tests/indicator-keyboard-test.in 2013-08-22 08:45:53 +0000
1809+++ tests/indicator-keyboard-test.in 2015-02-19 17:34:10 +0000
1810@@ -4,6 +4,7 @@
1811 export DCONF_PROFILE="@abs_top_builddir@/tests/profiles/indicator-keyboard-test"
1812 export GSETTINGS_SCHEMA_DIR="@abs_top_builddir@/data"
1813 export XDG_RUNTIME_DIR="@abs_top_builddir@/tests"
1814+export GTK_IM_MODULE="ibus"
1815
1816 if xvfb-run -a ./indicator-keyboard-tests
1817 then

Subscribers

People subscribed via source and target branches

to all changes: