Support the floating IME panel using the wl_input_panel_surface_interface 08/132408/1
authorWonkeun Oh <wonkeun.oh@samsung.com>
Thu, 1 Jun 2017 02:45:07 +0000 (11:45 +0900)
committerWonkeun Oh <wonkeun.oh@samsung.com>
Mon, 5 Jun 2017 02:28:18 +0000 (02:28 +0000)
It is better to use the input_panel_surface_interface.
because the Input FW doesn't need to care about the IME's panel_type.
IME just can set the their input_panel type using the 'wl_input_panel_surface_set_floating_panel' api.

Change-Id: I522a0094646ff3266fcadefffa3b8b25762cda48
(cherry picked from commit e12e2d131cc304aaba2b7870888a24c19c890850)

src/e_mod_input_panel.c

index fd32063..49772e2 100644 (file)
@@ -145,10 +145,28 @@ _e_input_panel_surface_cb_ready_set(struct wl_client *client EINA_UNUSED, struct
      }
 }
 
+static void
+ _e_input_panel_surface_cb_floating_panel_set(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, uint32_t state)
+{
+   E_Input_Panel_Surface *ips = wl_resource_get_user_data(resource);
+
+   if (!ips)
+     {
+        WTI_WARNING(resource,
+                    WL_DISPLAY_ERROR_INVALID_OBJECT,
+                    "No Input Panel Surface For Surface");
+        return;
+     }
+
+   if (ips->ec)
+     ips->ec->vkbd.floating = !!state;
+}
+
 static const struct wl_input_panel_surface_interface _e_input_panel_surface_implementation = {
      _e_input_panel_surface_cb_toplevel_set,
      _e_input_panel_surface_cb_overlay_panel_set,
-     _e_input_panel_surface_cb_ready_set
+     _e_input_panel_surface_cb_ready_set,
+     _e_input_panel_surface_cb_floating_panel_set
 };
 
 static void
@@ -228,7 +246,8 @@ _e_input_panel_position_set(E_Client *ec, int w, int h)
            break;
      }
 
-   e_client_util_move_without_frame(ec, nx, ny);
+   if (!ec->vkbd.floating)
+     e_client_util_move_without_frame(ec, nx, ny);
 }
 
 static void