ibus/setup-switch-im.patch
Hillwood Yang 4a0baf5a1c Accepting request 917124 from home:hillwood:branches:M17N
- Update version to 1.5.25
  * src/tests: Run gnome-session with no-overview mode 
  * client/gtk2: Implement ibus_im_context_set_surrounding_with_selection
  * src/ibuscomposetable: Do not include the same compose file 
  * src/ibusenginesimple: Multi_key to 0xB7
  * src/ibusenginesimple: Make Compose preedit less intrusive 
  * Change default Emoji shortcut key
  * setup: Enhance engine search function
  * client/gtk2/ibusimcontext: Enable sync process in GTK4
  * engine: Update simple.xml with xkeyboard-config 2.33
  * src/ibuscomposetable: Add support for the include directive (lf-)
  * src/ibuscomposetable: Fix a buffer overflow in compose handling (lf-)
  * client/x11: Add support for XFixes ClientDisconnectMode (Olivier Fourdan)
  * setup: Start ibus-daemon with the --daemonize option (Gunnar Hjalmarsson)
  * src: Fix a typo in ibusenginesimple.h (user202729)
  * Update translations

OBS-URL: https://build.opensuse.org/request/show/917124
OBS-URL: https://build.opensuse.org/package/show/M17N/ibus?expand=0&rev=255
2021-09-07 01:48:31 +00:00

68 lines
2.8 KiB
Diff

diff -Nur ibus-1.5.25/setup/main.py ibus-1.5.25-new/setup/main.py
--- ibus-1.5.25/setup/main.py 2021-08-20 08:48:40.000000000 +0800
+++ ibus-1.5.25-new/setup/main.py 2021-09-06 20:54:06.205651597 +0800
@@ -508,11 +508,16 @@
self.__engine_setup_exec_list[name] = os.spawnl(os.P_NOWAIT, *args)
def __init_bus(self):
+ method_name="ibus"
+ filename=".i18n"
+ usr_home =os.path.expanduser('~')
+
self.__bus = IBus.Bus()
if self.__bus.is_connected():
return
- message = _("The IBus daemon is not running. Do you wish to start it?")
+ message = _("Could not connect to IBus daemon.\n"
+ "Do you wish to switch to IBus on next login?")
dlg = Gtk.MessageDialog(message_type = Gtk.MessageType.QUESTION,
buttons = Gtk.ButtonsType.YES_NO,
text = message)
@@ -522,39 +527,12 @@
if id != Gtk.ResponseType.YES:
sys.exit(0)
- main_loop = GLib.MainLoop()
-
- timeout = 5
- GLib.timeout_add_seconds(timeout, lambda *args: main_loop.quit())
- self.__bus.connect("connected", lambda *args: main_loop.quit())
-
- os.spawnlp(os.P_NOWAIT, "ibus-daemon", "ibus-daemon", "--xim", "--daemonize")
-
- main_loop.run()
-
- if self.__bus.is_connected():
- message = _("IBus has been started! "
- "If you cannot use IBus, add the following lines to your $HOME/.bashrc; then relog into your desktop.\n"
- " export GTK_IM_MODULE=ibus\n"
- " export XMODIFIERS=@im=ibus\n"
- " export QT_IM_MODULE=ibus"
- )
- dlg = Gtk.MessageDialog(message_type = Gtk.MessageType.INFO,
- buttons = Gtk.ButtonsType.OK,
- text = message)
- id = dlg.run()
- dlg.destroy()
- self.__flush_gtk_events()
- else:
- # Translators: %d == 5 currently
- message = _("IBus daemon could not be started in %d seconds.")
- dlg = Gtk.MessageDialog(message_type = Gtk.MessageType.INFO,
- buttons = Gtk.ButtonsType.OK,
- text = message % timeout)
- id = dlg.run()
- dlg.destroy()
- self.__flush_gtk_events()
- sys.exit(0)
+ filename = os.path.join(usr_home, filename)
+ f=file(filename,"w+")
+ cmd = 'export INPUT_METHOD=\"' + method_name + '\"'
+ f.writelines(cmd)
+ f.close()
+ sys.exit(0)
def __shortcut_button_clicked_cb(self, button, name, section, _name, entry):
buttons = (_("_Cancel"), Gtk.ResponseType.CANCEL,