ecore/wayland: Hide Ecore_Wl_Display.
authorRafael Antognolli <rafael.antognolli@intel.com>
Thu, 31 Oct 2013 20:02:04 +0000 (18:02 -0200)
committerRafael Antognolli <rafael.antognolli@intel.com>
Thu, 31 Oct 2013 23:35:13 +0000 (21:35 -0200)
This struct is only used inside ecore_wayland itself, so there's no real
reason to expose it. Apparently, hiding it doesn't break anything,
except for the ecore_imf wayland module, which was easily fixed.

If anyone notices a breakage, please let me know.

src/lib/ecore_wayland/Ecore_Wayland.h
src/lib/ecore_wayland/ecore_wl_private.h
src/modules/ecore_imf/wayland/wayland_imcontext.c

index 7828281..d7b6c69 100644 (file)
@@ -31,7 +31,8 @@
 extern "C" {
 #endif
 
-typedef struct _Ecore_Wl_Display Ecore_Wl_Display;
+typedef struct _Ecore_Wl_Display Ecore_Wl_Display; /** FIXME: move to private */
+
 typedef struct _Ecore_Wl_Output Ecore_Wl_Output;
 typedef struct _Ecore_Wl_Input Ecore_Wl_Input;
 typedef struct _Ecore_Wl_Global Ecore_Wl_Global; /** @since 1.7.6 */
@@ -95,47 +96,6 @@ struct _Ecore_Wl_Global
    struct wl_list link;
 };
 
-struct _Ecore_Wl_Display
-{
-   struct 
-     {
-        struct wl_display *display;
-        struct wl_registry *registry;
-        struct wl_compositor *compositor;
-        struct wl_subcompositor *subcompositor;
-        struct wl_shell *shell;
-        struct wl_shell *desktop_shell;
-        struct wl_shm *shm;
-        struct wl_data_device_manager *data_device_manager;
-     } wl;
-
-   int fd;
-   unsigned int mask;
-   unsigned int serial;
-   int sync_ref_count;
-   Ecore_Fd_Handler *fd_hdl;
-   Ecore_Idle_Enterer *idle_enterer;
-
-   struct wl_list inputs;
-   struct wl_list outputs;
-   struct wl_list globals; /** @since 1.7.6 */
-
-   Eina_Bool init_done;
-
-   struct
-     {
-        struct xkb_context *context;
-     } xkb;
-
-   struct wl_cursor_theme *cursor_theme;
-
-   Ecore_Wl_Output *output;
-   Ecore_Wl_Input *input;
-
-   void (*output_configure)(Ecore_Wl_Output *output, void *data);
-   void *data;
-};
-
 struct _Ecore_Wl_Output
 {
    Ecore_Wl_Display *display;
index 581774b..fdbd3c9 100644 (file)
@@ -50,6 +50,48 @@ extern Ecore_Wl_Display *_ecore_wl_disp;
 # endif
 # define CRIT(...) EINA_LOG_DOM_CRIT(_ecore_wl_log_dom, __VA_ARGS__)
 
+
+struct _Ecore_Wl_Display
+{
+   struct
+     {
+        struct wl_display *display;
+        struct wl_registry *registry;
+        struct wl_compositor *compositor;
+        struct wl_subcompositor *subcompositor;
+        struct wl_shell *shell;
+        struct wl_shell *desktop_shell;
+        struct wl_shm *shm;
+        struct wl_data_device_manager *data_device_manager;
+     } wl;
+
+   int fd;
+   unsigned int mask;
+   unsigned int serial;
+   int sync_ref_count;
+   Ecore_Fd_Handler *fd_hdl;
+   Ecore_Idle_Enterer *idle_enterer;
+
+   struct wl_list inputs;
+   struct wl_list outputs;
+   struct wl_list globals; /** @since 1.7.6 */
+
+   Eina_Bool init_done;
+
+   struct
+     {
+        struct xkb_context *context;
+     } xkb;
+
+   struct wl_cursor_theme *cursor_theme;
+
+   Ecore_Wl_Output *output;
+   Ecore_Wl_Input *input;
+
+   void (*output_configure)(Ecore_Wl_Output *output, void *data);
+   void *data;
+};
+
 struct _Ecore_Wl_Dnd
 {
    Ecore_Wl_Display *ewd;
index a3e88d3..07072e4 100644 (file)
@@ -39,6 +39,7 @@ struct _WaylandIMContext
    struct wl_text_input *text_input;
 
    Ecore_Wl_Window *window;
+   Ecore_Wl_Input  *input;
    Evas            *canvas;
 
    char *preedit_text;
@@ -627,6 +628,8 @@ wayland_im_context_focus_in(Ecore_IMF_Context *ctx)
    if (!input || !input->seat)
      return;
 
+   imcontext->input = input;
+
    if (imcontext->text_input)
      {
         wl_text_input_show_input_panel(imcontext->text_input);
@@ -643,11 +646,13 @@ wayland_im_context_focus_out(Ecore_IMF_Context *ctx)
 
    EINA_LOG_DOM_INFO(_ecore_imf_wayland_log_dom, "focus-out");
 
-   if (!imcontext->window) return;
+   if (!imcontext->input) return;
 
    if (imcontext->text_input)
      wl_text_input_deactivate(imcontext->text_input,
-                              imcontext->window->display->input->seat);
+                              imcontext->input->seat);
+
+   imcontext->input = NULL;
 }
 
 EAPI void