imcontextwayland: Implement activate_osk() vmethod
authorCarlos Garnacho <carlosg@gnome.org>
Sun, 27 Nov 2022 12:04:29 +0000 (13:04 +0100)
committerCarlos Garnacho <carlosg@gnome.org>
Mon, 28 Nov 2022 14:46:41 +0000 (15:46 +0100)
This method does explicitly what the builtin GtkClickGesture in
the IM context is doing implicitly. The gesture will be dropped
after porting is done.

gtk/gtkimcontextwayland.c

index 0581772bd65050a3faaeada9d8dc193a4db8c213..f6c037313eec329a49ab5482b2c9e0bdd94f457c 100644 (file)
@@ -973,6 +973,20 @@ gtk_im_context_wayland_commit (GtkIMContext *context,
                     ZWP_TEXT_INPUT_V3_CHANGE_CAUSE_INPUT_METHOD);
 }
 
+static void
+gtk_im_context_wayland_activate_osk (GtkIMContext *context)
+{
+  GtkIMContextWaylandGlobal *global;
+
+  global = gtk_im_context_wayland_get_global (GTK_IM_CONTEXT_WAYLAND (context));
+  if (global == NULL)
+    return;
+
+  zwp_text_input_v3_enable (global->text_input);
+  notify_im_change (GTK_IM_CONTEXT_WAYLAND (context),
+                    ZWP_TEXT_INPUT_V3_CHANGE_CAUSE_OTHER);
+}
+
 static void
 gtk_im_context_wayland_class_init (GtkIMContextWaylandClass *klass)
 {
@@ -992,6 +1006,7 @@ gtk_im_context_wayland_class_init (GtkIMContextWaylandClass *klass)
   im_context_class->set_surrounding_with_selection = gtk_im_context_wayland_set_surrounding;
   im_context_class->get_surrounding_with_selection = gtk_im_context_wayland_get_surrounding;
   im_context_class->commit = gtk_im_context_wayland_commit;
+  im_context_class->activate_osk = gtk_im_context_wayland_activate_osk;
 }
 
 static void