typedef struct _Ecore_Wl_Event_Effect Ecore_Wl_Event_Effect_End;
typedef struct _Ecore_Wl_Display Ecore_Wl_Display;
typedef struct _Ecore_Wl_Event_Output_Transform Ecore_Wl_Event_Output_Transform;
+typedef struct _Ecore_Wl_Event_Ignore_Output_Transform Ecore_Wl_Event_Ignore_Output_Transform;
typedef struct _Ecore_Wl_Event_Global Ecore_Wl_Event_Global;
typedef struct _Ecore_Wl_Event_Keymap_Update Ecore_Wl_Event_Keymap_Update;
typedef struct _Ecore_Wl_Event_Indicator_Flick Ecore_Wl_Event_Indicator_Flick;
int transform;
};
+struct _Ecore_Wl_Event_Ignore_Output_Transform
+{
+ Ecore_Wl_Window *win;
+ Eina_Bool ignore;
+};
+
struct _Ecore_Wl_Event_Keymap_Update
{
Ecore_Wl_Input *input;
EAPI extern int ECORE_WL_EVENT_EFFECT_START;
EAPI extern int ECORE_WL_EVENT_EFFECT_END;
EAPI extern int ECORE_WL_EVENT_OUTPUT_TRANSFORM;
+EAPI extern int ECORE_WL_EVENT_IGNORE_OUTPUT_TRANSFORM;
EAPI extern int ECORE_WL_EVENT_GLOBAL_ADDED;
EAPI extern int ECORE_WL_EVENT_GLOBAL_REMOVED;
EAPI extern int ECORE_WL_EVENT_KEYMAP_UPDATE;
EAPI void ecore_wl_window_geometry_get(Ecore_Wl_Window *win, int *x, int *y, int *w, int *h);
EAPI Ecore_Wl_Input * ecore_wl_window_input_get(Ecore_Wl_Window *win);
+EAPI Eina_Bool ecore_wl_window_ignore_output_transform_get(Ecore_Wl_Window *win);
+
#ifdef __cplusplus
}
#endif
static void _ecore_wl_cb_indicator_flick(void *data EINA_UNUSED, struct tizen_indicator *tizen_indicator EINA_UNUSED, struct wl_surface *surface_resource, int type);
static void _ecore_wl_cb_clipboard_data_selected(void *data EINA_UNUSED, struct tizen_clipboard *clipboard EINA_UNUSED, struct wl_surface *surface);
static void _ecore_wl_cb_clipboard_data_only_allowed(void *data EINA_UNUSED, struct tizen_clipboard *clipboard EINA_UNUSED, uint32_t allowed);
+static void _ecore_wl_cb_ignore_output_transform(void *data EINA_UNUSED, struct tizen_screen_rotation *tizen_screen_rotation EINA_UNUSED, struct wl_surface *surface, uint32_t ignore);
+
static void _ecore_wl_log_cb_print(const char *format, va_list args);
/* local variables */
static int _ecore_wl_init_count = 0;
_ecore_wl_cb_clipboard_data_only_allowed,
};
+static const struct tizen_screen_rotation_listener _ecore_tizen_screen_rotation_listener =
+{
+ _ecore_wl_cb_ignore_output_transform,
+};
+
static void
xdg_shell_ping(void *data EINA_UNUSED, struct xdg_shell *shell, uint32_t serial)
{
EAPI int ECORE_WL_EVENT_EFFECT_START = 0;
EAPI int ECORE_WL_EVENT_EFFECT_END = 0;
EAPI int ECORE_WL_EVENT_OUTPUT_TRANSFORM = 0;
+EAPI int ECORE_WL_EVENT_IGNORE_OUTPUT_TRANSFORM = 0;
EAPI int ECORE_WL_EVENT_GLOBAL_ADDED = 0;
EAPI int ECORE_WL_EVENT_GLOBAL_REMOVED = 0;
EAPI int ECORE_WL_EVENT_KEYMAP_UPDATE = 0;
ECORE_WL_EVENT_EFFECT_START = ecore_event_type_new();
ECORE_WL_EVENT_EFFECT_END = ecore_event_type_new();
ECORE_WL_EVENT_OUTPUT_TRANSFORM = ecore_event_type_new();
+ ECORE_WL_EVENT_IGNORE_OUTPUT_TRANSFORM = ecore_event_type_new();
ECORE_WL_EVENT_GLOBAL_ADDED = ecore_event_type_new();
ECORE_WL_EVENT_GLOBAL_REMOVED = ecore_event_type_new();
ECORE_WL_EVENT_KEYMAP_UPDATE = ecore_event_type_new();
tizen_indicator_destroy(_ecore_wl_disp->wl.tz_indicator);
if (_ecore_wl_disp->wl.tz_clipboard)
tizen_clipboard_destroy(_ecore_wl_disp->wl.tz_clipboard);
+ if (_ecore_wl_disp->wl.tz_screen_rotation)
+ tizen_screen_rotation_destroy(_ecore_wl_disp->wl.tz_screen_rotation);
if (_ecore_wl_disp->cursor_theme)
wl_cursor_theme_destroy(_ecore_wl_disp->cursor_theme);
if (_ecore_wl_disp->wl.display)
if (ewd->wl.tz_clipboard)
tizen_clipboard_add_listener(ewd->wl.tz_clipboard, &_ecore_tizen_clipboard_listener, ewd->wl.display);
}
+ else if (!strcmp(interface, "tizen_screen_rotation"))
+ {
+ ewd->wl.tz_screen_rotation =
+ wl_registry_bind(registry, id, &tizen_screen_rotation_interface, 1);
+ if (ewd->wl.tz_screen_rotation)
+ tizen_screen_rotation_add_listener(ewd->wl.tz_screen_rotation, &_ecore_tizen_screen_rotation_listener, ewd->wl.display);
+ }
if ((ewd->wl.compositor) && (ewd->wl.shm) &&
((ewd->wl.shell) || (ewd->wl.xdg_shell)))
_ecore_wl_disp->input->is_data_only = EINA_FALSE;
}
+static void
+_ecore_wl_cb_ignore_output_transform(void *data EINA_UNUSED, struct tizen_screen_rotation *tizen_screen_rotation EINA_UNUSED, struct wl_surface *surface, uint32_t ignore)
+{
+ Ecore_Wl_Window *win = NULL;
+ Ecore_Wl_Event_Ignore_Output_Transform *ev;
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!surface) return;
+ win = ecore_wl_window_surface_find(surface);
+ if (!win) return;
+
+ _ecore_wl_window_ignore_output_transform_set(win, ignore);
+
+ if (!(ev = calloc(1, sizeof(Ecore_Wl_Event_Ignore_Output_Transform)))) return;
+
+ ev->win = win;
+ ev->ignore = (ignore) ? EINA_TRUE : EINA_FALSE;
+ ecore_event_add(ECORE_WL_EVENT_IGNORE_OUTPUT_TRANSFORM, ev, NULL, NULL);
+}
+
static void
_ecore_wl_log_cb_print(const char *format, va_list args)
{
struct tizen_effect *tz_effect;
struct tizen_indicator *tz_indicator;
struct tizen_clipboard *tz_clipboard;
+ struct tizen_screen_rotation *tz_screen_rotation;
Eina_Bool prepare_read;
} wl;
Eina_Bool focus_skip : 1;
Eina_Bool iconified : 1;
Eina_Bool floating : 1;
+ Eina_Bool ignore_output_transform : 1;
struct
{
void _ecore_wl_animator_vsync_tick_quit(void *data);
/* TIZEN_ONLY : To use vsync as a custom source of animator */
+void _ecore_wl_window_ignore_output_transform_set(Ecore_Wl_Window *win, Eina_Bool ignore);
+
#endif
win->surface = wl_compositor_create_surface(wlcomp);
if (!win->surface) return NULL;
win->surface_id = wl_proxy_get_id((struct wl_proxy *)win->surface);
+ if (_ecore_wl_disp->wl.tz_screen_rotation)
+ tizen_screen_rotation_get_ignore_output_transform(_ecore_wl_disp->wl.tz_screen_rotation, win->surface);
return win->surface;
}
return NULL;
}
+
+void
+_ecore_wl_window_ignore_output_transform_set(Ecore_Wl_Window *win, Eina_Bool ignore)
+{
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+ if (!win) return;
+
+ win->ignore_output_transform = ignore;
+}
+
+EAPI Eina_Bool
+ecore_wl_window_ignore_output_transform_get(Ecore_Wl_Window *win)
+{
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ return win->ignore_output_transform;
+}
_ecore_evas_wl_common_rotate_update(Ecore_Evas *ee)
{
Ecore_Evas_Engine_Wl_Data *wdata;
- Ecore_Wl_Output *output;
int rotation;
wdata = ee->engine.data;
- output = ecore_wl_window_output_find(wdata->win);
- rotation = ecore_wl_output_transform_get(output) * 90;
+
+ if (ecore_wl_window_ignore_output_transform_get(wdata->win))
+ rotation = 0;
+ else
+ {
+ Ecore_Wl_Output *output = ecore_wl_window_output_find(wdata->win);
+ rotation = ecore_wl_output_transform_get(output) * 90;
+ }
+
+ WRN("ignore_output_transform(%d) rotation(%d)", ecore_wl_window_ignore_output_transform_get(wdata->win), rotation);
if (_ecore_evas_wl_common_engine_rotation_get(ee) == ((rotation + ee->rotation) % 360))
return;
if (output != ev->output) return ECORE_CALLBACK_PASS_ON;
_ecore_evas_wl_common_rotate_update(ee);
+ evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
+ _ecore_evas_wl_common_render(ee);
+
+ return ECORE_CALLBACK_PASS_ON;
+}
+
+static Eina_Bool
+_ecore_evas_wl_common_cb_ignore_output_transform(void *data, int type EINA_UNUSED, void *event EINA_UNUSED)
+{
+ Ecore_Evas *ee = data;
+
+ if (!ee) return ECORE_CALLBACK_PASS_ON;
+
+ _ecore_evas_wl_common_rotate_update(ee);
+ evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
+ _ecore_evas_wl_common_render(ee);
return ECORE_CALLBACK_PASS_ON;
}
wdata = ee->engine.data;
if (wdata->output_transform_hdl)
ecore_event_handler_del(wdata->output_transform_hdl);
+ if (wdata->ignore_output_transform_hdl)
+ ecore_event_handler_del(wdata->ignore_output_transform_hdl);
if (wdata->anim_callback)
wl_callback_destroy(wdata->anim_callback);
if (wdata->win) ecore_wl_window_free(wdata->win);
wdata->output_transform_hdl =
ecore_event_handler_add(ECORE_WL_EVENT_OUTPUT_TRANSFORM,
_ecore_evas_wl_common_cb_output_transform, ee);
+ wdata->ignore_output_transform_hdl =
+ ecore_event_handler_add(ECORE_WL_EVENT_IGNORE_OUTPUT_TRANSFORM,
+ _ecore_evas_wl_common_cb_ignore_output_transform, ee);
+
}
static void
Ecore_Event_Handler *output_transform_hdl;
short output_rotation;
+
+ Ecore_Event_Handler *ignore_output_transform_hdl;
};
Ecore_Evas_Interface_Wayland *_ecore_evas_wl_interface_new(void);