2011-12-08 08:19:44 -08:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include <config.h>
|
|
|
|
#endif
|
|
|
|
|
2011-12-06 14:33:01 -08:00
|
|
|
#include <stdlib.h>
|
2009-01-31 10:33:39 -08:00
|
|
|
#include <string.h>
|
2011-12-08 08:19:44 -08:00
|
|
|
|
|
|
|
#include <Eina.h>
|
|
|
|
#include <Ecore.h>
|
2013-03-11 13:11:44 -07:00
|
|
|
#include "ecore_private.h"
|
|
|
|
#include <Ecore_Input.h>
|
|
|
|
#include <Ecore_Input_Evas.h>
|
2011-12-08 08:19:44 -08:00
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
#include <Ecore_X.h>
|
|
|
|
#include <Ecore_X_Atoms.h>
|
|
|
|
|
|
|
|
#ifdef BUILD_ECORE_EVAS_SOFTWARE_X11
|
|
|
|
# include <Evas_Engine_Software_X11.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef BUILD_ECORE_EVAS_OPENGL_X11
|
|
|
|
# include <Evas_Engine_GL_X11.h>
|
|
|
|
#endif
|
|
|
|
|
2013-03-11 13:11:44 -07:00
|
|
|
#include <Ecore_Evas.h>
|
|
|
|
#include "ecore_evas_private.h"
|
|
|
|
#include "ecore_evas_x11.h"
|
|
|
|
|
2013-01-11 10:45:10 -08:00
|
|
|
#define EDBG(...) \
|
|
|
|
EINA_LOG(_ecore_evas_log_dom, EINA_LOG_LEVEL_DBG + 1, __VA_ARGS__);
|
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
static int _ecore_evas_init_count = 0;
|
|
|
|
|
2010-02-01 06:13:48 -08:00
|
|
|
static Ecore_Event_Handler *ecore_evas_event_handlers[13];
|
2003-09-23 01:09:32 -07:00
|
|
|
|
2010-10-01 18:56:23 -07:00
|
|
|
static int leader_ref = 0;
|
|
|
|
static Ecore_X_Window leader_win = 0;
|
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
static const char *interface_x11_name = "x11";
|
|
|
|
static const int interface_x11_version = 1;
|
|
|
|
|
|
|
|
static const char *interface_software_x11_name = "software_x11";
|
|
|
|
static const int interface_software_x11_version = 1;
|
|
|
|
|
2014-05-30 05:34:13 -07:00
|
|
|
#ifdef BUILD_ECORE_EVAS_OPENGL_X11
|
2012-12-05 13:15:42 -08:00
|
|
|
static const char *interface_gl_x11_name = "gl_x11";
|
2014-05-30 05:34:13 -07:00
|
|
|
#endif
|
2012-12-05 13:15:42 -08:00
|
|
|
static const int interface_gl_x11_version = 1;
|
|
|
|
|
|
|
|
typedef struct _Ecore_Evas_Engine_Data_X11 Ecore_Evas_Engine_Data_X11;
|
|
|
|
|
|
|
|
struct _Ecore_Evas_Engine_Data_X11 {
|
|
|
|
Ecore_X_Window win_root;
|
|
|
|
Eina_List *win_extra;
|
|
|
|
Ecore_X_Pixmap pmap;
|
|
|
|
Ecore_X_Pixmap mask;
|
|
|
|
Ecore_X_GC gc;
|
|
|
|
Ecore_X_XRegion *damages;
|
2013-10-18 03:23:38 -07:00
|
|
|
Ecore_Timer *outdelay;
|
|
|
|
Ecore_X_Event_Mouse_Out out_ev;
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_X_Sync_Counter sync_counter;
|
|
|
|
Ecore_X_Window leader;
|
|
|
|
Ecore_X_Sync_Counter netwm_sync_counter;
|
|
|
|
int netwm_sync_val_hi;
|
|
|
|
unsigned int netwm_sync_val_lo;
|
|
|
|
int sync_val; // bigger! this will screw up at 2 billion fram~
|
|
|
|
int screen_num;
|
|
|
|
int px, py, pw, ph;
|
|
|
|
unsigned char direct_resize : 1;
|
|
|
|
unsigned char using_bg_pixmap : 1;
|
|
|
|
unsigned char managed : 1;
|
|
|
|
unsigned char sync_began : 1;
|
|
|
|
unsigned char sync_cancel : 1;
|
|
|
|
unsigned char netwm_sync_set : 1;
|
|
|
|
unsigned char configure_coming : 1;
|
|
|
|
struct {
|
|
|
|
unsigned char modal : 1;
|
|
|
|
unsigned char sticky : 1;
|
|
|
|
unsigned char maximized_v : 1;
|
|
|
|
unsigned char maximized_h : 1;
|
|
|
|
unsigned char shaded : 1;
|
|
|
|
unsigned char skip_taskbar : 1;
|
|
|
|
unsigned char skip_pager : 1;
|
|
|
|
unsigned char fullscreen : 1;
|
|
|
|
unsigned char above : 1;
|
|
|
|
unsigned char below : 1;
|
|
|
|
} state;
|
|
|
|
struct {
|
|
|
|
unsigned char available : 1; // need to setup available profiles in a w
|
|
|
|
unsigned char change : 1; // need to send change event to the WM
|
|
|
|
unsigned char done : 1; // need to send change done event to the WM
|
|
|
|
} profile;
|
2014-02-08 16:46:51 -08:00
|
|
|
struct {
|
|
|
|
unsigned char supported: 1;
|
|
|
|
unsigned char prepare : 1;
|
|
|
|
unsigned char request : 1;
|
|
|
|
unsigned char done : 1;
|
|
|
|
unsigned char configure_coming : 1;
|
|
|
|
Ecore_Job *manual_mode_job;
|
|
|
|
} wm_rot;
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_X_Window win_shaped_input;
|
2014-01-11 01:19:43 -08:00
|
|
|
struct
|
2013-07-05 02:38:43 -07:00
|
|
|
{
|
|
|
|
unsigned int front, back; // front and back pixmaps (double-buffer)
|
|
|
|
Evas_Coord w, h; // store pixmap size (saves X roundtrips)
|
|
|
|
int depth; // store depth to save us from fetching engine info pre_render
|
2013-07-11 02:22:17 -07:00
|
|
|
void *visual; // store visual used to create pixmap
|
|
|
|
unsigned long colormap; // store colormap used to create pixmap
|
2013-07-05 02:38:43 -07:00
|
|
|
} pixmap;
|
2013-07-24 05:58:57 -07:00
|
|
|
Eina_Bool destroyed : 1; // X window has been deleted and cannot be used
|
2012-12-05 13:15:42 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
static Ecore_Evas_Interface_X11 * _ecore_evas_x_interface_x11_new(void);
|
|
|
|
#ifdef BUILD_ECORE_EVAS_SOFTWARE_X11
|
|
|
|
static Ecore_Evas_Interface_Software_X11 *_ecore_evas_x_interface_software_x11_new(void);
|
|
|
|
#endif
|
|
|
|
#ifdef BUILD_ECORE_EVAS_OPENGL_X11
|
|
|
|
static Ecore_Evas_Interface_Gl_X11 *_ecore_evas_x_interface_gl_x11_new(void);
|
|
|
|
#endif
|
2014-02-08 16:46:51 -08:00
|
|
|
static void _ecore_evas_x_rotation_set(Ecore_Evas *ee, int rotation, int resize);
|
|
|
|
static Eina_Bool _ecore_evas_x_wm_rot_manual_rotation_done_timeout(void *data);
|
|
|
|
static void _ecore_evas_x_wm_rot_manual_rotation_done_timeout_update(Ecore_Evas *ee);
|
2014-02-27 14:20:01 -08:00
|
|
|
static void _ecore_evas_x_aux_hints_set(Ecore_Evas *ee, const char *hints);
|
2012-12-05 13:15:42 -08:00
|
|
|
|
2012-12-18 08:27:26 -08:00
|
|
|
static void _resize_shape_do(Ecore_Evas *);
|
|
|
|
static void _shaped_do(Ecore_Evas *, int);
|
|
|
|
static void _alpha_do(Ecore_Evas *, int);
|
|
|
|
static void _transparent_do(Ecore_Evas *, int);
|
|
|
|
static void _avoid_damage_do(Ecore_Evas *, int);
|
|
|
|
static void _rotation_do(Ecore_Evas *, int, int);
|
|
|
|
|
2012-02-27 22:43:59 -08:00
|
|
|
static void
|
|
|
|
_ecore_evas_x_hints_update(Ecore_Evas *ee)
|
|
|
|
{
|
|
|
|
ecore_x_icccm_hints_set
|
|
|
|
(ee->prop.window,
|
|
|
|
!ee->prop.focus_skip /* accepts_focus */,
|
2014-01-11 01:19:43 -08:00
|
|
|
ee->prop.iconified ? ECORE_X_WINDOW_STATE_HINT_ICONIC :
|
|
|
|
ee->prop.withdrawn ? ECORE_X_WINDOW_STATE_HINT_WITHDRAWN :
|
2012-02-27 22:43:59 -08:00
|
|
|
ECORE_X_WINDOW_STATE_HINT_NORMAL /* initial_state */,
|
|
|
|
0 /* icon_pixmap */,
|
|
|
|
0 /* icon_mask */,
|
|
|
|
0 /* icon_window */,
|
|
|
|
ee->prop.group_ee_win /* window_group */,
|
|
|
|
ee->prop.urgent /* is_urgent */);
|
|
|
|
}
|
|
|
|
|
2010-10-01 18:56:23 -07:00
|
|
|
static void
|
|
|
|
_ecore_evas_x_group_leader_set(Ecore_Evas *ee)
|
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
|
2010-10-01 18:56:23 -07:00
|
|
|
leader_ref++;
|
|
|
|
if (leader_ref == 1)
|
|
|
|
{
|
2011-07-26 04:24:10 -07:00
|
|
|
char *id = NULL;
|
|
|
|
|
2011-09-21 23:02:26 -07:00
|
|
|
leader_win =
|
2012-12-05 13:15:42 -08:00
|
|
|
ecore_x_window_override_new(edata->win_root, 1234, 5678, 1, 2);
|
2010-10-01 18:56:23 -07:00
|
|
|
ecore_x_window_defaults_set(leader_win);
|
2011-07-26 04:24:10 -07:00
|
|
|
if ((id = getenv("DESKTOP_STARTUP_ID")))
|
|
|
|
ecore_x_netwm_startup_id_set(leader_win,id);
|
2010-10-01 18:56:23 -07:00
|
|
|
ecore_x_icccm_client_leader_set(leader_win, leader_win);
|
|
|
|
}
|
2012-12-05 13:15:42 -08:00
|
|
|
edata->leader = leader_win;
|
2010-10-01 18:56:23 -07:00
|
|
|
ecore_x_icccm_client_leader_set(ee->prop.window, leader_win);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_ecore_evas_x_group_leader_unset(Ecore_Evas *ee)
|
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
|
2013-07-24 05:58:57 -07:00
|
|
|
if (!edata->destroyed)
|
|
|
|
ecore_x_window_prop_property_del(ee->prop.window,
|
|
|
|
ECORE_X_ATOM_WM_CLIENT_LEADER);
|
2012-12-05 13:15:42 -08:00
|
|
|
if (edata->leader == leader_win)
|
2010-10-01 18:56:23 -07:00
|
|
|
{
|
|
|
|
leader_ref--;
|
|
|
|
if (leader_ref <= 0)
|
|
|
|
{
|
|
|
|
ecore_x_window_free(leader_win);
|
|
|
|
leader_win = 0;
|
|
|
|
}
|
2012-12-05 13:15:42 -08:00
|
|
|
edata->leader = 0;
|
2010-10-01 18:56:23 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_ecore_evas_x_group_leader_update(Ecore_Evas *ee)
|
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
|
|
|
|
if (edata->leader)
|
|
|
|
ecore_x_icccm_client_leader_set(ee->prop.window, edata->leader);
|
2010-10-01 18:56:23 -07:00
|
|
|
}
|
|
|
|
|
2010-01-29 02:28:54 -08:00
|
|
|
static void
|
|
|
|
_ecore_evas_x_protocols_set(Ecore_Evas *ee)
|
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
|
2011-11-14 10:48:19 -08:00
|
|
|
Ecore_X_Atom protos[3];
|
2011-07-26 04:24:10 -07:00
|
|
|
unsigned int num = 0, tmp = 0;
|
2011-04-20 07:15:33 -07:00
|
|
|
|
2010-01-29 02:28:54 -08:00
|
|
|
if (ee->func.fn_delete_request)
|
2011-11-14 10:48:19 -08:00
|
|
|
protos[num++] = ECORE_X_ATOM_WM_DELETE_WINDOW;
|
2010-02-02 19:20:22 -08:00
|
|
|
protos[num++] = ECORE_X_ATOM_NET_WM_PING;
|
2011-03-30 03:10:04 -07:00
|
|
|
protos[num++] = ECORE_X_ATOM_NET_WM_SYNC_REQUEST;
|
2010-01-29 03:06:32 -08:00
|
|
|
ecore_x_icccm_protocol_atoms_set(ee->prop.window, protos, num);
|
2011-04-20 07:15:33 -07:00
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
if (!edata->netwm_sync_counter)
|
|
|
|
edata->netwm_sync_counter = ecore_x_sync_counter_new(0);
|
2011-07-26 04:24:10 -07:00
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
tmp = edata->netwm_sync_counter;
|
2011-07-26 04:24:10 -07:00
|
|
|
ecore_x_window_prop_card32_set(ee->prop.window,
|
|
|
|
ECORE_X_ATOM_NET_WM_SYNC_REQUEST_COUNTER,
|
|
|
|
&tmp, 1);
|
2013-03-06 23:33:59 -08:00
|
|
|
|
|
|
|
// set property on window to say "I talk the deiconify approve protcol"
|
|
|
|
tmp = 1;
|
|
|
|
ecore_x_window_prop_card32_set(ee->prop.window,
|
|
|
|
ECORE_X_ATOM_E_DEICONIFY_APPROVE,
|
|
|
|
&tmp, 1);
|
2010-01-29 02:28:54 -08:00
|
|
|
}
|
|
|
|
|
2010-01-30 02:42:22 -08:00
|
|
|
static void
|
|
|
|
_ecore_evas_x_sync_set(Ecore_Evas *ee)
|
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
|
|
|
|
Ecore_X_Sync_Counter sync_counter = edata->sync_counter;
|
2012-07-03 00:44:17 -07:00
|
|
|
|
2010-10-10 23:28:01 -07:00
|
|
|
if (((ee->should_be_visible) || (ee->visible)) &&
|
2012-12-05 13:15:42 -08:00
|
|
|
((ecore_x_e_comp_sync_supported_get(edata->win_root)) &&
|
2010-10-10 23:28:01 -07:00
|
|
|
(!ee->no_comp_sync) && (_ecore_evas_app_comp_sync)))
|
2010-02-01 06:13:48 -08:00
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
if (!edata->sync_counter)
|
|
|
|
edata->sync_counter = ecore_x_sync_counter_new(0);
|
2010-02-01 06:13:48 -08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
if (edata->sync_counter)
|
2012-07-03 00:44:17 -07:00
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
ecore_x_sync_counter_free(edata->sync_counter);
|
|
|
|
edata->sync_val = 0;
|
2012-07-03 00:44:17 -07:00
|
|
|
}
|
2012-12-05 13:15:42 -08:00
|
|
|
edata->sync_counter = 0;
|
2010-02-01 06:13:48 -08:00
|
|
|
}
|
2013-07-24 05:58:57 -07:00
|
|
|
if ((!edata->destroyed) && (sync_counter != edata->sync_counter))
|
|
|
|
ecore_x_e_comp_sync_counter_set(ee->prop.window, edata->sync_counter);
|
2010-01-30 02:42:22 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_ecore_evas_x_sync_clear(Ecore_Evas *ee)
|
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
|
|
|
|
|
|
|
|
if (!edata->sync_counter) return;
|
|
|
|
ecore_x_sync_counter_free(edata->sync_counter);
|
|
|
|
edata->sync_val = 0;
|
|
|
|
edata->sync_counter = 0;
|
2010-01-30 02:42:22 -08:00
|
|
|
}
|
|
|
|
|
2014-02-08 16:46:51 -08:00
|
|
|
static void
|
|
|
|
_ecore_evas_x_wm_rotation_protocol_set(Ecore_Evas *ee)
|
|
|
|
{
|
|
|
|
Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
|
|
|
|
|
|
|
|
if (ecore_x_e_window_rotation_supported_get(edata->win_root))
|
|
|
|
ee->prop.wm_rot.supported = 1;
|
|
|
|
else
|
|
|
|
ee->prop.wm_rot.supported = 0;
|
|
|
|
}
|
|
|
|
|
2012-12-04 22:48:46 -08:00
|
|
|
static void
|
|
|
|
_ecore_evas_x_window_profile_protocol_set(Ecore_Evas *ee)
|
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
|
|
|
|
|
2012-12-04 22:48:46 -08:00
|
|
|
/* check and set profile protocol hint */
|
2012-12-05 13:15:42 -08:00
|
|
|
if (ecore_x_e_window_profile_supported_get(edata->win_root))
|
2012-12-04 22:48:46 -08:00
|
|
|
{
|
|
|
|
unsigned int v = 1;
|
|
|
|
ecore_x_window_prop_card32_set
|
|
|
|
(ee->prop.window,
|
|
|
|
ECORE_X_ATOM_E_WINDOW_PROFILE_SUPPORTED,
|
|
|
|
&v, 1);
|
|
|
|
|
|
|
|
ee->profile_supported = 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
ee->profile_supported = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_ecore_evas_x_window_profile_set(Ecore_Evas *ee)
|
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
|
|
|
|
|
2012-12-04 22:48:46 -08:00
|
|
|
if (((ee->should_be_visible) || (ee->visible)) &&
|
|
|
|
(ee->profile_supported))
|
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
if (edata->profile.available)
|
2012-12-04 22:48:46 -08:00
|
|
|
{
|
|
|
|
ecore_x_e_window_available_profiles_set
|
|
|
|
(ee->prop.window,
|
|
|
|
(const char **)ee->prop.profile.available_list,
|
|
|
|
(const int)ee->prop.profile.count);
|
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
edata->profile.available = 0;
|
2012-12-04 22:48:46 -08:00
|
|
|
}
|
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
if (edata->profile.change)
|
2012-12-04 22:48:46 -08:00
|
|
|
{
|
|
|
|
if (ee->prop.profile.name)
|
|
|
|
{
|
|
|
|
/* We need to keep the profile as an x property to let the WM.
|
|
|
|
* Then the WM reads it when creating the border window.
|
|
|
|
*/
|
|
|
|
Ecore_X_Atom a = ecore_x_atom_get(ee->prop.profile.name);
|
|
|
|
ecore_x_window_prop_atom_set
|
|
|
|
(ee->prop.window,
|
|
|
|
ECORE_X_ATOM_E_WINDOW_PROFILE_CHANGE,
|
|
|
|
&a, 1);
|
|
|
|
|
|
|
|
ecore_x_e_window_profile_change_send
|
2012-12-05 13:15:42 -08:00
|
|
|
(edata->win_root,
|
2012-12-04 22:48:46 -08:00
|
|
|
ee->prop.window,
|
|
|
|
ee->prop.profile.name);
|
|
|
|
}
|
2012-12-05 13:15:42 -08:00
|
|
|
edata->profile.change = 0;
|
2012-12-04 22:48:46 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-02-08 16:46:51 -08:00
|
|
|
static void
|
|
|
|
_ecore_evas_x_wm_rot_manual_rotation_done_job(void *data)
|
|
|
|
{
|
|
|
|
Ecore_Evas *ee = (Ecore_Evas *)data;
|
|
|
|
Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
|
|
|
|
|
|
|
|
edata->wm_rot.manual_mode_job = NULL;
|
|
|
|
ee->prop.wm_rot.manual_mode.wait_for_done = EINA_FALSE;
|
|
|
|
|
|
|
|
ecore_x_e_window_rotation_change_done_send
|
|
|
|
(edata->win_root, ee->prop.window, ee->rotation, ee->w, ee->h);
|
|
|
|
|
|
|
|
edata->wm_rot.done = 0;
|
|
|
|
}
|
|
|
|
|
2014-02-27 14:20:01 -08:00
|
|
|
static void
|
|
|
|
_ecore_evas_x_aux_hints_supprted_update(Ecore_Evas *ee)
|
|
|
|
{
|
|
|
|
Ecore_X_Window root = ecore_x_window_root_first_get();
|
|
|
|
unsigned char *data = NULL;
|
|
|
|
unsigned int num = 0, i = 0;
|
|
|
|
int res = 0, n = 0;
|
|
|
|
char **str;
|
|
|
|
const char *hint;
|
|
|
|
|
|
|
|
EINA_LIST_FREE(ee->prop.aux_hint.supported_list, hint)
|
|
|
|
{
|
|
|
|
eina_stringshare_del(hint);
|
|
|
|
}
|
|
|
|
|
|
|
|
res = ecore_x_window_prop_property_get
|
|
|
|
(root, ECORE_X_ATOM_E_WINDOW_AUX_HINT_SUPPORTED_LIST,
|
|
|
|
ECORE_X_ATOM_STRING, 0, &data, &n);
|
|
|
|
|
2014-03-05 06:31:22 -08:00
|
|
|
if ((res == 8) && (n > 0))
|
2014-02-27 14:20:01 -08:00
|
|
|
{
|
|
|
|
str = eina_str_split_full((char *)data, ",", -1, &num);
|
|
|
|
for (i = 0; i < num; i++)
|
|
|
|
{
|
|
|
|
hint = eina_stringshare_add(str[i]);
|
2014-03-05 06:31:22 -08:00
|
|
|
ee->prop.aux_hint.supported_list =
|
|
|
|
eina_list_append(ee->prop.aux_hint.supported_list, hint);
|
2014-02-27 14:20:01 -08:00
|
|
|
}
|
|
|
|
|
2014-08-13 00:15:42 -07:00
|
|
|
if (str)
|
2014-02-27 14:20:01 -08:00
|
|
|
{
|
|
|
|
free(str[0]);
|
|
|
|
free(str);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
free(data);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_ecore_evas_x_aux_hints_update(Ecore_Evas *ee)
|
|
|
|
{
|
|
|
|
Eina_Strbuf *buf = _ecore_evas_aux_hints_string_get(ee);
|
|
|
|
if (buf)
|
|
|
|
{
|
|
|
|
_ecore_evas_x_aux_hints_set(ee, eina_strbuf_string_get(buf));
|
|
|
|
eina_strbuf_free(buf);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-07-26 04:24:10 -07:00
|
|
|
# ifdef BUILD_ECORE_EVAS_OPENGL_X11
|
2006-03-08 00:02:55 -08:00
|
|
|
static Ecore_X_Window
|
2014-01-12 21:26:36 -08:00
|
|
|
_ecore_evas_x_gl_window_new(Ecore_Evas *ee, Ecore_X_Window parent, int x, int y, int w, int h, Eina_Bool override, int argb, const int *opt)
|
2006-03-08 00:02:55 -08:00
|
|
|
{
|
|
|
|
Evas_Engine_Info_GL_X11 *einfo;
|
|
|
|
Ecore_X_Window win;
|
Here is ecore_x with XCB backend.
* The XCB backend is disabled by default during the
configuration. To enable it, add --enable-ecore-x-xcb. See the
messages that configure displays when it finishes.
* The way XCB is detected, and used in src/lib/ecore_x/Makefile.am
should be improved
* Any program that uses ecore_evas does not need to be modified.
Any program that uses ecore_x may need some changes. That is,
adding some functions (_prefetch and _fetch ones). No other
change is needed. See the documention of any _get functions, as
these are the ones that need those functions.
* There are some missing parts, especially everything that involves
the keyboard, as porting Xlib functions related to strings (utf8
stuff, XKeysymToString, etc...) is an horror. So keyboard events
are not working yet.
* I tried to write as much documentation as I could. But there is
certainly some missing doc here and there.
there are certainly other things that I have forgotten.
Improvements of that backend:
* the creation of an ecore_evas is faster. Especially when done over
an ssh connection (on my computer, 7-10s with Xlib, 1.5s with XCB,
over an ssh)
* A Window Manager should be more responsive. But it's not tomorrow
that e17 will use it :)
Have fun !
SVN revision: 29500
2007-04-13 10:15:19 -07:00
|
|
|
|
2006-03-08 00:02:55 -08:00
|
|
|
einfo = (Evas_Engine_Info_GL_X11 *)evas_engine_info_get(ee->evas);
|
|
|
|
if (einfo)
|
|
|
|
{
|
2010-09-29 10:03:38 -07:00
|
|
|
int screen;
|
2006-03-08 00:02:55 -08:00
|
|
|
|
2010-02-14 21:05:05 -08:00
|
|
|
if (opt)
|
|
|
|
{
|
|
|
|
int op;
|
2011-04-20 07:15:33 -07:00
|
|
|
|
2010-02-14 21:05:05 -08:00
|
|
|
for (op = 0; opt[op]; op++)
|
|
|
|
{
|
|
|
|
if (opt[op] == ECORE_EVAS_GL_X11_OPT_INDIRECT)
|
|
|
|
{
|
|
|
|
op++;
|
|
|
|
einfo->indirect = opt[op];
|
|
|
|
}
|
2010-12-26 02:17:31 -08:00
|
|
|
else if (opt[op] == ECORE_EVAS_GL_X11_OPT_VSYNC)
|
|
|
|
{
|
|
|
|
op++;
|
|
|
|
einfo->vsync = opt[op];
|
|
|
|
}
|
2012-09-26 23:57:16 -07:00
|
|
|
#ifdef EVAS_ENGINE_GL_X11_SWAP_MODE_EXISTS
|
2012-09-27 00:00:28 -07:00
|
|
|
else if (opt[op] == ECORE_EVAS_GL_X11_OPT_SWAP_MODE)
|
2012-09-26 23:57:16 -07:00
|
|
|
{
|
|
|
|
op++;
|
|
|
|
if ((evas_version->major >= 1) &&
|
|
|
|
(evas_version->minor >= 7) &&
|
2012-09-27 00:13:15 -07:00
|
|
|
(evas_version->micro >= 99))
|
2012-09-27 00:00:28 -07:00
|
|
|
einfo->swap_mode = opt[op];
|
2012-09-26 23:57:16 -07:00
|
|
|
}
|
2014-01-11 01:19:43 -08:00
|
|
|
#endif
|
2010-02-14 21:05:05 -08:00
|
|
|
}
|
|
|
|
}
|
2011-04-20 07:15:33 -07:00
|
|
|
|
2010-09-29 10:03:38 -07:00
|
|
|
/* FIXME: this is inefficient as its 1 or more round trips */
|
2011-07-26 04:24:10 -07:00
|
|
|
screen = ecore_x_screen_index_get(ecore_x_default_screen_get());
|
|
|
|
if (ecore_x_screen_count_get() > 1)
|
2010-09-29 10:03:38 -07:00
|
|
|
{
|
|
|
|
Ecore_X_Window *roots;
|
|
|
|
int num, i;
|
|
|
|
|
|
|
|
num = 0;
|
|
|
|
roots = ecore_x_window_root_list(&num);
|
|
|
|
if (roots)
|
|
|
|
{
|
2011-07-26 04:24:10 -07:00
|
|
|
Ecore_X_Window root;
|
2010-09-29 10:03:38 -07:00
|
|
|
|
2011-07-26 04:24:10 -07:00
|
|
|
root = ecore_x_window_root_get(parent);
|
2011-09-21 23:02:26 -07:00
|
|
|
for (i = 0; i < num; i++)
|
2010-09-29 10:03:38 -07:00
|
|
|
{
|
2011-09-21 23:02:26 -07:00
|
|
|
if (root == roots[i])
|
2010-09-29 10:03:38 -07:00
|
|
|
{
|
2011-07-26 04:24:10 -07:00
|
|
|
screen = i;
|
|
|
|
break;
|
2010-09-29 10:03:38 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
free(roots);
|
|
|
|
}
|
|
|
|
}
|
2011-07-26 04:24:10 -07:00
|
|
|
|
|
|
|
einfo->info.display = ecore_x_display_get();
|
|
|
|
einfo->info.screen = screen;
|
2011-04-20 07:15:33 -07:00
|
|
|
|
2010-02-28 20:44:36 -08:00
|
|
|
einfo->info.destination_alpha = argb;
|
2011-04-20 07:15:33 -07:00
|
|
|
|
2011-07-26 04:24:10 -07:00
|
|
|
einfo->info.visual = einfo->func.best_visual_get(einfo);
|
2010-09-29 10:03:38 -07:00
|
|
|
einfo->info.colormap = einfo->func.best_colormap_get(einfo);
|
2011-07-26 04:24:10 -07:00
|
|
|
einfo->info.depth = einfo->func.best_depth_get(einfo);
|
2010-02-14 21:26:42 -08:00
|
|
|
|
2011-09-21 23:02:26 -07:00
|
|
|
if ((!einfo->info.visual) ||
|
2011-07-26 04:24:10 -07:00
|
|
|
(!einfo->info.colormap) || (!einfo->info.depth))
|
2010-02-14 21:26:42 -08:00
|
|
|
{
|
2010-05-17 20:50:17 -07:00
|
|
|
WRN("OpenGL X11 init engine '%s' failed - no visual, colormap or depth.", ee->driver);
|
2010-09-16 23:14:08 -07:00
|
|
|
if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
|
|
|
|
{
|
2010-09-29 09:45:49 -07:00
|
|
|
ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
|
2010-09-16 23:14:08 -07:00
|
|
|
return 0;
|
|
|
|
}
|
2010-02-14 21:26:42 -08:00
|
|
|
}
|
2014-10-25 04:04:52 -07:00
|
|
|
win = ecore_x_window_full_new(parent, x, y, w, h,
|
|
|
|
einfo->info.visual,
|
|
|
|
einfo->info.colormap,
|
|
|
|
einfo->info.depth,
|
|
|
|
override);
|
2011-07-26 04:24:10 -07:00
|
|
|
ecore_x_window_pixel_gravity_set(win, ECORE_X_GRAVITY_FORGET);
|
2014-07-24 22:45:50 -07:00
|
|
|
ecore_x_vsync_animator_tick_source_set(win);
|
2011-07-26 04:24:10 -07:00
|
|
|
|
|
|
|
/* attr.backing_store = NotUseful; */
|
|
|
|
/* attr.override_redirect = override; */
|
|
|
|
/* attr.colormap = einfo->info.colormap; */
|
|
|
|
/* attr.border_pixel = 0; */
|
|
|
|
/* attr.background_pixmap = None; */
|
|
|
|
/* attr.event_mask = */
|
|
|
|
/* KeyPressMask | KeyReleaseMask | */
|
|
|
|
/* ExposureMask | ButtonPressMask | ButtonReleaseMask | */
|
|
|
|
/* EnterWindowMask | LeaveWindowMask | */
|
|
|
|
/* PointerMotionMask | StructureNotifyMask | VisibilityChangeMask | */
|
|
|
|
/* FocusChangeMask | PropertyChangeMask | ColormapChangeMask; */
|
|
|
|
/* attr.bit_gravity = ForgetGravity; */
|
|
|
|
|
|
|
|
/* win = */
|
|
|
|
/* XCreateWindow(einfo->info.display, parent, x, y, w, h, 0, */
|
|
|
|
/* einfo->info.depth, InputOutput, einfo->info.visual, */
|
|
|
|
/* CWBackingStore | CWColormap | CWBackPixmap | */
|
|
|
|
/* CWBorderPixel | CWBitGravity | CWEventMask | */
|
|
|
|
/* CWOverrideRedirect, &attr); */
|
|
|
|
|
2010-09-29 10:03:38 -07:00
|
|
|
einfo->info.drawable = win;
|
2010-09-29 09:45:49 -07:00
|
|
|
|
|
|
|
if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
|
2010-05-17 20:50:17 -07:00
|
|
|
{
|
2013-11-21 01:45:27 -08:00
|
|
|
WRN("evas_engine_info_set() for engine '%s' failed.", ee->driver);
|
2011-07-26 04:24:10 -07:00
|
|
|
ecore_x_window_free(win);
|
2010-05-17 20:50:17 -07:00
|
|
|
return 0;
|
|
|
|
}
|
2006-08-10 19:26:16 -07:00
|
|
|
}
|
2011-07-26 04:24:10 -07:00
|
|
|
else
|
|
|
|
win = 0;
|
|
|
|
|
2006-03-08 00:02:55 -08:00
|
|
|
return win;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2009-02-27 23:54:47 -08:00
|
|
|
static int
|
2012-12-18 08:27:26 -08:00
|
|
|
_render_updates_process(Ecore_Evas *ee, Eina_List *updates)
|
2005-07-06 20:31:34 -07:00
|
|
|
{
|
2009-02-27 23:54:47 -08:00
|
|
|
int rend = 0;
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
|
Here is ecore_x with XCB backend.
* The XCB backend is disabled by default during the
configuration. To enable it, add --enable-ecore-x-xcb. See the
messages that configure displays when it finishes.
* The way XCB is detected, and used in src/lib/ecore_x/Makefile.am
should be improved
* Any program that uses ecore_evas does not need to be modified.
Any program that uses ecore_x may need some changes. That is,
adding some functions (_prefetch and _fetch ones). No other
change is needed. See the documention of any _get functions, as
these are the ones that need those functions.
* There are some missing parts, especially everything that involves
the keyboard, as porting Xlib functions related to strings (utf8
stuff, XKeysymToString, etc...) is an horror. So keyboard events
are not working yet.
* I tried to write as much documentation as I could. But there is
certainly some missing doc here and there.
there are certainly other things that I have forgotten.
Improvements of that backend:
* the creation of an ecore_evas is faster. Especially when done over
an ssh connection (on my computer, 7-10s with Xlib, 1.5s with XCB,
over an ssh)
* A Window Manager should be more responsive. But it's not tomorrow
that e17 will use it :)
Have fun !
SVN revision: 29500
2007-04-13 10:15:19 -07:00
|
|
|
|
2011-09-21 23:02:26 -07:00
|
|
|
if (ee->prop.avoid_damage)
|
2005-07-06 20:31:34 -07:00
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
if (edata->using_bg_pixmap)
|
2010-09-29 10:03:38 -07:00
|
|
|
{
|
2011-09-21 23:02:26 -07:00
|
|
|
if (updates)
|
2010-09-29 10:03:38 -07:00
|
|
|
{
|
2011-09-21 19:39:23 -07:00
|
|
|
Eina_List *l = NULL;
|
|
|
|
Eina_Rectangle *r;
|
|
|
|
|
2010-09-29 10:03:38 -07:00
|
|
|
EINA_LIST_FOREACH(updates, l, r)
|
2011-09-21 23:02:26 -07:00
|
|
|
ecore_x_window_area_clear(ee->prop.window,
|
2011-09-21 19:39:23 -07:00
|
|
|
r->x, r->y, r->w, r->h);
|
2011-09-21 23:02:26 -07:00
|
|
|
if (ee->shaped)
|
2010-05-21 00:10:45 -07:00
|
|
|
{
|
2011-09-21 23:02:26 -07:00
|
|
|
ecore_x_window_shape_mask_set(ee->prop.window,
|
2012-12-05 13:15:42 -08:00
|
|
|
edata->mask);
|
2010-05-21 00:10:45 -07:00
|
|
|
}
|
2011-09-21 19:39:23 -07:00
|
|
|
if (ee->alpha)
|
2010-05-21 00:10:45 -07:00
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
// ecore_x_window_shape_input_mask_set(ee->prop.window, edata->mask);
|
2010-05-21 00:10:45 -07:00
|
|
|
}
|
2010-09-29 10:03:38 -07:00
|
|
|
_ecore_evas_idle_timeout_update(ee);
|
2009-02-27 23:54:47 -08:00
|
|
|
rend = 1;
|
2010-09-29 10:03:38 -07:00
|
|
|
}
|
|
|
|
}
|
2011-09-21 23:02:26 -07:00
|
|
|
else
|
2010-09-29 10:03:38 -07:00
|
|
|
{
|
2011-09-21 23:02:26 -07:00
|
|
|
if (updates)
|
2010-09-29 10:03:38 -07:00
|
|
|
{
|
2011-09-21 19:39:23 -07:00
|
|
|
Eina_List *l = NULL;
|
|
|
|
Eina_Rectangle *r;
|
2010-09-29 10:03:38 -07:00
|
|
|
|
2011-09-21 19:39:23 -07:00
|
|
|
EINA_LIST_FOREACH(updates, l, r)
|
2010-09-29 10:03:38 -07:00
|
|
|
{
|
2011-09-21 19:39:23 -07:00
|
|
|
Ecore_X_Rectangle rect;
|
|
|
|
Ecore_X_XRegion *tmpr;
|
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
if (!edata->damages)
|
|
|
|
edata->damages = ecore_x_xregion_new();
|
2011-09-21 19:39:23 -07:00
|
|
|
tmpr = ecore_x_xregion_new();
|
|
|
|
if (ee->rotation == 0)
|
|
|
|
{
|
|
|
|
rect.x = r->x;
|
|
|
|
rect.y = r->y;
|
|
|
|
rect.width = r->w;
|
|
|
|
rect.height = r->h;
|
|
|
|
}
|
|
|
|
else if (ee->rotation == 90)
|
|
|
|
{
|
|
|
|
rect.x = r->y;
|
|
|
|
rect.y = ee->h - r->x - r->w;
|
|
|
|
rect.width = r->h;
|
|
|
|
rect.height = r->w;
|
|
|
|
}
|
|
|
|
else if (ee->rotation == 180)
|
|
|
|
{
|
|
|
|
rect.x = ee->w - r->x - r->w;
|
|
|
|
rect.y = ee->h - r->y - r->h;
|
|
|
|
rect.width = r->w;
|
|
|
|
rect.height = r->h;
|
|
|
|
}
|
|
|
|
else if (ee->rotation == 270)
|
|
|
|
{
|
|
|
|
rect.x = ee->w - r->y - r->h;
|
|
|
|
rect.y = r->x;
|
|
|
|
rect.width = r->h;
|
|
|
|
rect.height = r->w;
|
|
|
|
}
|
2012-12-05 13:15:42 -08:00
|
|
|
ecore_x_xregion_union_rect(tmpr, edata->damages,
|
2011-09-21 19:39:23 -07:00
|
|
|
&rect);
|
2012-12-05 13:15:42 -08:00
|
|
|
ecore_x_xregion_free(edata->damages);
|
|
|
|
edata->damages = tmpr;
|
2010-09-29 10:03:38 -07:00
|
|
|
}
|
2012-12-05 13:15:42 -08:00
|
|
|
if (edata->damages)
|
2010-09-29 10:03:38 -07:00
|
|
|
{
|
2011-09-21 19:39:23 -07:00
|
|
|
if (ee->shaped)
|
2012-08-10 01:41:10 -07:00
|
|
|
{
|
|
|
|
/* if we have a damage pixmap - we can avoid exposures by
|
|
|
|
* disabling them just for setting the mask */
|
2012-08-10 01:45:28 -07:00
|
|
|
ecore_x_event_mask_unset(ee->prop.window, ECORE_X_EVENT_MASK_WINDOW_DAMAGE);
|
2012-08-10 01:41:10 -07:00
|
|
|
ecore_x_window_shape_mask_set(ee->prop.window,
|
2012-12-05 13:15:42 -08:00
|
|
|
edata->mask);
|
2012-08-10 01:41:10 -07:00
|
|
|
/* and re-enable them again */
|
2012-08-10 01:45:28 -07:00
|
|
|
ecore_x_event_mask_set(ee->prop.window, ECORE_X_EVENT_MASK_WINDOW_DAMAGE);
|
2012-08-10 01:41:10 -07:00
|
|
|
}
|
2012-12-05 13:15:42 -08:00
|
|
|
ecore_x_xregion_set(edata->damages, edata->gc);
|
|
|
|
ecore_x_pixmap_paste(edata->pmap, ee->prop.window,
|
|
|
|
edata->gc, 0, 0, ee->w, ee->h,
|
2011-09-21 19:39:23 -07:00
|
|
|
0, 0);
|
2012-12-05 13:15:42 -08:00
|
|
|
ecore_x_xregion_free(edata->damages);
|
|
|
|
edata->damages = NULL;
|
2010-09-29 10:03:38 -07:00
|
|
|
}
|
|
|
|
_ecore_evas_idle_timeout_update(ee);
|
2009-02-27 23:54:47 -08:00
|
|
|
rend = 1;
|
2010-09-29 10:03:38 -07:00
|
|
|
}
|
|
|
|
}
|
2005-07-06 20:31:34 -07:00
|
|
|
}
|
2011-09-21 23:02:26 -07:00
|
|
|
else if (((ee->visible) && (ee->draw_ok)) ||
|
|
|
|
((ee->should_be_visible) && (ee->prop.fullscreen)) ||
|
|
|
|
((ee->should_be_visible) && (ee->prop.override)))
|
2005-07-06 20:31:34 -07:00
|
|
|
{
|
2011-09-21 23:02:26 -07:00
|
|
|
if (updates)
|
2010-02-14 23:23:58 -08:00
|
|
|
{
|
2011-09-21 23:02:26 -07:00
|
|
|
if (ee->shaped)
|
2010-05-21 00:10:45 -07:00
|
|
|
{
|
2011-09-21 23:02:26 -07:00
|
|
|
ecore_x_window_shape_mask_set(ee->prop.window,
|
2012-12-05 13:15:42 -08:00
|
|
|
edata->mask);
|
2010-05-21 00:10:45 -07:00
|
|
|
}
|
|
|
|
if (ee->alpha)
|
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
// ecore_x_window_shape_input_mask_set(ee->prop.window, edata->mask);
|
2010-05-21 00:10:45 -07:00
|
|
|
}
|
2010-02-14 23:23:58 -08:00
|
|
|
_ecore_evas_idle_timeout_update(ee);
|
|
|
|
rend = 1;
|
|
|
|
}
|
2005-07-06 20:31:34 -07:00
|
|
|
}
|
2007-01-16 02:17:46 -08:00
|
|
|
else
|
|
|
|
evas_norender(ee->evas);
|
2012-08-28 22:18:27 -07:00
|
|
|
|
2005-07-06 20:31:34 -07:00
|
|
|
if (ee->func.fn_post_render) ee->func.fn_post_render(ee);
|
2012-12-18 08:27:26 -08:00
|
|
|
|
2011-04-20 07:15:33 -07:00
|
|
|
/*
|
2010-02-01 06:13:48 -08:00
|
|
|
if (rend)
|
|
|
|
{
|
|
|
|
static int frames = 0;
|
|
|
|
static double t0 = 0.0;
|
|
|
|
double t, td;
|
2011-04-20 07:15:33 -07:00
|
|
|
|
2010-02-01 06:13:48 -08:00
|
|
|
t = ecore_time_get();
|
|
|
|
frames++;
|
|
|
|
if ((t - t0) > 1.0)
|
|
|
|
{
|
|
|
|
td = t - t0;
|
|
|
|
printf("FPS: %3.3f\n", (double)frames / td);
|
|
|
|
frames = 0;
|
|
|
|
t0 = t;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
*/
|
2009-02-27 23:54:47 -08:00
|
|
|
return rend;
|
2005-07-06 20:31:34 -07:00
|
|
|
}
|
|
|
|
|
2005-05-03 10:35:50 -07:00
|
|
|
static void
|
2012-12-18 08:27:26 -08:00
|
|
|
_ecore_evas_x_render_updates(void *data, Evas *e EINA_UNUSED, void *event_info)
|
|
|
|
{
|
2013-03-25 19:48:23 -07:00
|
|
|
Evas_Event_Render_Post *ev = event_info;
|
2012-12-18 08:27:26 -08:00
|
|
|
Ecore_Evas *ee = data;
|
2013-03-25 19:48:23 -07:00
|
|
|
|
2013-06-20 04:28:18 -07:00
|
|
|
if (!ev) return;
|
2012-12-18 08:27:26 -08:00
|
|
|
|
2013-01-11 10:45:10 -08:00
|
|
|
EDBG("ee=%p finished asynchronous render.", ee);
|
2012-12-18 08:27:26 -08:00
|
|
|
|
|
|
|
ee->in_async_render = EINA_FALSE;
|
|
|
|
|
2013-03-25 19:48:23 -07:00
|
|
|
_render_updates_process(ee, ev->updated_area);
|
2013-01-11 10:45:10 -08:00
|
|
|
|
2012-12-18 08:27:26 -08:00
|
|
|
if (ee->delayed.resize_shape)
|
|
|
|
{
|
|
|
|
_resize_shape_do(ee);
|
|
|
|
ee->delayed.resize_shape = EINA_FALSE;
|
|
|
|
}
|
|
|
|
if (ee->delayed.shaped_changed)
|
|
|
|
{
|
|
|
|
_shaped_do(ee, ee->delayed.shaped);
|
|
|
|
ee->delayed.shaped_changed = EINA_FALSE;
|
|
|
|
}
|
|
|
|
if (ee->delayed.alpha_changed)
|
|
|
|
{
|
|
|
|
_alpha_do(ee, ee->delayed.alpha);
|
|
|
|
ee->delayed.alpha_changed = EINA_FALSE;
|
|
|
|
}
|
|
|
|
if (ee->delayed.transparent_changed)
|
|
|
|
{
|
|
|
|
_transparent_do(ee, ee->delayed.transparent);
|
|
|
|
ee->delayed.transparent_changed = EINA_FALSE;
|
|
|
|
}
|
|
|
|
if (ee->delayed.avoid_damage != ee->prop.avoid_damage)
|
|
|
|
_avoid_damage_do(ee, ee->delayed.avoid_damage);
|
|
|
|
if (ee->delayed.rotation_changed)
|
|
|
|
{
|
|
|
|
_rotation_do(ee, ee->delayed.rotation, ee->delayed.rotation_resize);
|
|
|
|
ee->delayed.rotation_changed = EINA_FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
_ecore_evas_x_render(Ecore_Evas *ee)
|
2005-05-03 10:35:50 -07:00
|
|
|
{
|
2012-12-18 08:27:26 -08:00
|
|
|
int rend = 0;
|
|
|
|
Eina_List *ll;
|
|
|
|
Ecore_Evas *ee2;
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
|
|
|
|
|
2012-12-18 08:27:26 -08:00
|
|
|
if ((!ee->no_comp_sync) && (_ecore_evas_app_comp_sync) &&
|
|
|
|
(edata->sync_counter) && (!edata->sync_began) &&
|
|
|
|
(!edata->sync_cancel))
|
|
|
|
return 0;
|
|
|
|
|
2013-01-11 10:45:10 -08:00
|
|
|
if (ee->in_async_render)
|
|
|
|
{
|
|
|
|
EDBG("ee=%p is rendering asynchronously, skip.", ee);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2012-12-18 08:27:26 -08:00
|
|
|
EINA_LIST_FOREACH(ee->sub_ecore_evas, ll, ee2)
|
Here is ecore_x with XCB backend.
* The XCB backend is disabled by default during the
configuration. To enable it, add --enable-ecore-x-xcb. See the
messages that configure displays when it finishes.
* The way XCB is detected, and used in src/lib/ecore_x/Makefile.am
should be improved
* Any program that uses ecore_evas does not need to be modified.
Any program that uses ecore_x may need some changes. That is,
adding some functions (_prefetch and _fetch ones). No other
change is needed. See the documention of any _get functions, as
these are the ones that need those functions.
* There are some missing parts, especially everything that involves
the keyboard, as porting Xlib functions related to strings (utf8
stuff, XKeysymToString, etc...) is an horror. So keyboard events
are not working yet.
* I tried to write as much documentation as I could. But there is
certainly some missing doc here and there.
there are certainly other things that I have forgotten.
Improvements of that backend:
* the creation of an ecore_evas is faster. Especially when done over
an ssh connection (on my computer, 7-10s with Xlib, 1.5s with XCB,
over an ssh)
* A Window Manager should be more responsive. But it's not tomorrow
that e17 will use it :)
Have fun !
SVN revision: 29500
2007-04-13 10:15:19 -07:00
|
|
|
{
|
2012-12-18 08:27:26 -08:00
|
|
|
if (ee2->func.fn_pre_render) ee2->func.fn_pre_render(ee2);
|
|
|
|
if (ee2->engine.func->fn_render)
|
|
|
|
rend |= ee2->engine.func->fn_render(ee2);
|
|
|
|
if (ee2->func.fn_post_render) ee2->func.fn_post_render(ee2);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ee->func.fn_pre_render) ee->func.fn_pre_render(ee);
|
2013-01-11 10:45:10 -08:00
|
|
|
if (!ee->can_async_render)
|
2012-12-18 08:27:26 -08:00
|
|
|
{
|
2013-01-11 10:45:10 -08:00
|
|
|
Eina_List *updates = evas_render_updates(ee->evas);
|
|
|
|
rend = _render_updates_process(ee, updates);
|
2013-03-25 19:48:23 -07:00
|
|
|
evas_render_updates_free(updates);
|
2012-12-18 08:27:26 -08:00
|
|
|
}
|
2013-03-25 19:48:23 -07:00
|
|
|
else if (evas_render_async(ee->evas))
|
2012-12-18 08:27:26 -08:00
|
|
|
{
|
2013-01-11 10:45:10 -08:00
|
|
|
EDBG("ee=%p started asynchronous render.", ee);
|
|
|
|
ee->in_async_render = EINA_TRUE;
|
|
|
|
rend = 1;
|
2012-12-18 08:27:26 -08:00
|
|
|
}
|
2014-08-21 03:31:07 -07:00
|
|
|
else if (ee->func.fn_post_render) ee->func.fn_post_render(ee);
|
2013-01-11 10:45:10 -08:00
|
|
|
|
2012-12-18 08:27:26 -08:00
|
|
|
return rend;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_resize_shape_do(Ecore_Evas *ee)
|
|
|
|
{
|
2009-07-14 14:18:27 -07:00
|
|
|
#ifdef BUILD_ECORE_EVAS_SOFTWARE_X11
|
2012-12-18 08:27:26 -08:00
|
|
|
Evas_Engine_Info_Software_X11 *einfo;
|
|
|
|
Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
|
Here is ecore_x with XCB backend.
* The XCB backend is disabled by default during the
configuration. To enable it, add --enable-ecore-x-xcb. See the
messages that configure displays when it finishes.
* The way XCB is detected, and used in src/lib/ecore_x/Makefile.am
should be improved
* Any program that uses ecore_evas does not need to be modified.
Any program that uses ecore_x may need some changes. That is,
adding some functions (_prefetch and _fetch ones). No other
change is needed. See the documention of any _get functions, as
these are the ones that need those functions.
* There are some missing parts, especially everything that involves
the keyboard, as porting Xlib functions related to strings (utf8
stuff, XKeysymToString, etc...) is an horror. So keyboard events
are not working yet.
* I tried to write as much documentation as I could. But there is
certainly some missing doc here and there.
there are certainly other things that I have forgotten.
Improvements of that backend:
* the creation of an ecore_evas is faster. Especially when done over
an ssh connection (on my computer, 7-10s with Xlib, 1.5s with XCB,
over an ssh)
* A Window Manager should be more responsive. But it's not tomorrow
that e17 will use it :)
Have fun !
SVN revision: 29500
2007-04-13 10:15:19 -07:00
|
|
|
|
2012-12-18 08:27:26 -08:00
|
|
|
einfo = (Evas_Engine_Info_Software_X11 *)evas_engine_info_get(ee->evas);
|
|
|
|
if (einfo)
|
|
|
|
{
|
|
|
|
unsigned int foreground;
|
|
|
|
Ecore_X_GC gc;
|
|
|
|
|
|
|
|
if (edata->mask) ecore_x_pixmap_free(edata->mask);
|
|
|
|
edata->mask = ecore_x_pixmap_new(ee->prop.window, ee->w, ee->h, 1);
|
|
|
|
foreground = 0;
|
|
|
|
gc = ecore_x_gc_new(edata->mask,
|
|
|
|
ECORE_X_GC_VALUE_MASK_FOREGROUND,
|
|
|
|
&foreground);
|
|
|
|
ecore_x_drawable_rectangle_fill(edata->mask, gc,
|
|
|
|
0, 0, ee->w, ee->h);
|
|
|
|
ecore_x_gc_free(gc);
|
|
|
|
einfo->info.mask = edata->mask;
|
|
|
|
if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
|
2010-09-29 10:03:38 -07:00
|
|
|
{
|
2012-12-18 08:27:26 -08:00
|
|
|
ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
|
2010-09-29 10:03:38 -07:00
|
|
|
}
|
2012-12-18 08:27:26 -08:00
|
|
|
evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
|
|
|
|
}
|
2009-07-14 14:18:27 -07:00
|
|
|
#endif /* BUILD_ECORE_EVAS_SOFTWARE_X11 */
|
2012-12-18 08:27:26 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_ecore_evas_x_resize_shape(Ecore_Evas *ee)
|
|
|
|
{
|
|
|
|
if (!strcmp(ee->driver, "software_x11"))
|
|
|
|
{
|
|
|
|
if (ee->in_async_render)
|
|
|
|
{
|
|
|
|
ee->delayed.resize_shape = EINA_TRUE;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
_resize_shape_do(ee);
|
2006-03-08 00:02:55 -08:00
|
|
|
}
|
2005-05-03 10:35:50 -07:00
|
|
|
}
|
|
|
|
|
2006-07-26 19:42:41 -07:00
|
|
|
/* TODO: we need to make this work for all the states, not just sticky */
|
2010-06-24 09:15:56 -07:00
|
|
|
static Eina_Bool
|
2012-11-25 01:55:32 -08:00
|
|
|
_ecore_evas_x_event_property_change(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
2006-07-26 19:42:41 -07:00
|
|
|
{
|
|
|
|
Ecore_Evas *ee;
|
Here is ecore_x with XCB backend.
* The XCB backend is disabled by default during the
configuration. To enable it, add --enable-ecore-x-xcb. See the
messages that configure displays when it finishes.
* The way XCB is detected, and used in src/lib/ecore_x/Makefile.am
should be improved
* Any program that uses ecore_evas does not need to be modified.
Any program that uses ecore_x may need some changes. That is,
adding some functions (_prefetch and _fetch ones). No other
change is needed. See the documention of any _get functions, as
these are the ones that need those functions.
* There are some missing parts, especially everything that involves
the keyboard, as porting Xlib functions related to strings (utf8
stuff, XKeysymToString, etc...) is an horror. So keyboard events
are not working yet.
* I tried to write as much documentation as I could. But there is
certainly some missing doc here and there.
there are certainly other things that I have forgotten.
Improvements of that backend:
* the creation of an ecore_evas is faster. Especially when done over
an ssh connection (on my computer, 7-10s with Xlib, 1.5s with XCB,
over an ssh)
* A Window Manager should be more responsive. But it's not tomorrow
that e17 will use it :)
Have fun !
SVN revision: 29500
2007-04-13 10:15:19 -07:00
|
|
|
Ecore_X_Event_Window_Property *e;
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Engine_Data_X11 *edata;
|
2012-02-27 22:43:59 -08:00
|
|
|
int state_change = 0;
|
2006-07-26 19:42:41 -07:00
|
|
|
|
|
|
|
e = event;
|
2009-03-19 06:06:16 -07:00
|
|
|
ee = ecore_event_window_match(e->win);
|
2010-06-24 09:15:56 -07:00
|
|
|
if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON; /* pass on event */
|
2012-12-05 13:15:42 -08:00
|
|
|
edata = ee->engine.data;
|
2010-06-24 09:15:56 -07:00
|
|
|
if (e->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
|
2006-07-26 19:42:41 -07:00
|
|
|
if (e->atom == ECORE_X_ATOM_NET_WM_STATE)
|
|
|
|
{
|
2010-09-29 10:03:38 -07:00
|
|
|
unsigned int i, num;
|
|
|
|
Ecore_X_Window_State *state;
|
2012-02-28 02:46:38 -08:00
|
|
|
struct {
|
|
|
|
struct {
|
|
|
|
unsigned char modal : 1;
|
|
|
|
unsigned char sticky : 1;
|
|
|
|
unsigned char maximized_v : 1;
|
|
|
|
unsigned char maximized_h : 1;
|
|
|
|
unsigned char shaded : 1;
|
|
|
|
unsigned char skip_taskbar : 1;
|
|
|
|
unsigned char skip_pager : 1;
|
|
|
|
unsigned char fullscreen : 1;
|
|
|
|
unsigned char above : 1;
|
|
|
|
unsigned char below : 1;
|
|
|
|
} x;
|
|
|
|
struct {
|
|
|
|
char modal : 1;
|
|
|
|
char maximized : 1;
|
|
|
|
char sticky : 1;
|
|
|
|
char fullscreen : 1;
|
|
|
|
char focus_skip : 1;
|
|
|
|
} prop;
|
|
|
|
} prev;
|
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
prev.x.modal = edata->state.modal;
|
|
|
|
prev.x.sticky = edata->state.sticky;
|
|
|
|
prev.x.maximized_v = edata->state.maximized_v;
|
|
|
|
prev.x.maximized_h = edata->state.maximized_h;
|
|
|
|
prev.x.shaded = edata->state.shaded;
|
|
|
|
prev.x.skip_taskbar = edata->state.skip_taskbar;
|
|
|
|
prev.x.skip_pager = edata->state.skip_pager;
|
|
|
|
prev.x.fullscreen = edata->state.fullscreen;
|
|
|
|
prev.x.above = edata->state.above;
|
|
|
|
prev.x.below = edata->state.below;
|
2012-02-28 02:46:38 -08:00
|
|
|
|
|
|
|
prev.prop.modal = ee->prop.modal;
|
|
|
|
prev.prop.maximized = ee->prop.maximized;
|
|
|
|
prev.prop.sticky = ee->prop.sticky;
|
|
|
|
prev.prop.fullscreen = ee->prop.fullscreen;
|
|
|
|
prev.prop.focus_skip = ee->prop.focus_skip;
|
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
edata->state.modal = 0;
|
|
|
|
edata->state.sticky = 0;
|
|
|
|
edata->state.maximized_v = 0;
|
|
|
|
edata->state.maximized_h = 0;
|
|
|
|
edata->state.shaded = 0;
|
|
|
|
edata->state.skip_taskbar = 0;
|
|
|
|
edata->state.skip_pager = 0;
|
|
|
|
edata->state.fullscreen = 0;
|
|
|
|
edata->state.above = 0;
|
|
|
|
edata->state.below = 0;
|
2012-02-28 02:46:38 -08:00
|
|
|
|
2014-01-12 21:26:36 -08:00
|
|
|
ee->prop.modal = EINA_FALSE;
|
|
|
|
ee->prop.maximized = EINA_FALSE;
|
|
|
|
ee->prop.sticky = EINA_FALSE;
|
|
|
|
ee->prop.fullscreen = EINA_FALSE;
|
2014-11-23 05:01:34 -08:00
|
|
|
// ee->prop.focus_skip = EINA_FALSE;
|
2012-02-27 22:43:59 -08:00
|
|
|
|
2010-09-29 10:03:38 -07:00
|
|
|
ecore_x_netwm_window_state_get(e->win, &state, &num);
|
|
|
|
if (state)
|
|
|
|
{
|
|
|
|
for (i = 0; i < num; i++)
|
|
|
|
{
|
|
|
|
switch (state[i])
|
|
|
|
{
|
|
|
|
case ECORE_X_WINDOW_STATE_MODAL:
|
2012-12-05 13:15:42 -08:00
|
|
|
edata->state.modal = 1;
|
2014-01-12 21:26:36 -08:00
|
|
|
ee->prop.modal = EINA_TRUE;
|
2012-02-27 22:43:59 -08:00
|
|
|
break;
|
2010-09-29 10:03:38 -07:00
|
|
|
case ECORE_X_WINDOW_STATE_STICKY:
|
2014-01-12 21:26:36 -08:00
|
|
|
ee->prop.sticky = EINA_TRUE;
|
2012-12-05 13:15:42 -08:00
|
|
|
edata->state.sticky = 1;
|
2012-02-27 22:43:59 -08:00
|
|
|
break;
|
2010-09-29 10:03:38 -07:00
|
|
|
case ECORE_X_WINDOW_STATE_MAXIMIZED_VERT:
|
2012-12-05 13:15:42 -08:00
|
|
|
edata->state.maximized_v = 1;
|
2014-01-12 21:26:36 -08:00
|
|
|
ee->prop.maximized = EINA_TRUE;
|
2012-02-27 22:43:59 -08:00
|
|
|
break;
|
2010-09-29 10:03:38 -07:00
|
|
|
case ECORE_X_WINDOW_STATE_MAXIMIZED_HORZ:
|
2012-12-05 13:15:42 -08:00
|
|
|
edata->state.maximized_h = 1;
|
2014-01-12 21:26:36 -08:00
|
|
|
ee->prop.maximized = EINA_TRUE;
|
2012-02-27 22:43:59 -08:00
|
|
|
break;
|
2010-09-29 10:03:38 -07:00
|
|
|
case ECORE_X_WINDOW_STATE_SHADED:
|
2012-12-05 13:15:42 -08:00
|
|
|
edata->state.shaded = 1;
|
2012-02-27 22:43:59 -08:00
|
|
|
break;
|
2010-09-29 10:03:38 -07:00
|
|
|
case ECORE_X_WINDOW_STATE_SKIP_TASKBAR:
|
2012-12-05 13:15:42 -08:00
|
|
|
edata->state.skip_taskbar = 1;
|
2012-02-27 22:43:59 -08:00
|
|
|
break;
|
2010-09-29 10:03:38 -07:00
|
|
|
case ECORE_X_WINDOW_STATE_SKIP_PAGER:
|
2012-12-05 13:15:42 -08:00
|
|
|
edata->state.skip_pager = 1;
|
2012-02-27 22:43:59 -08:00
|
|
|
break;
|
2010-09-29 10:03:38 -07:00
|
|
|
case ECORE_X_WINDOW_STATE_FULLSCREEN:
|
2012-02-27 22:43:59 -08:00
|
|
|
ee->prop.fullscreen = 1;
|
2012-12-05 13:15:42 -08:00
|
|
|
edata->state.fullscreen = 1;
|
2012-02-27 22:43:59 -08:00
|
|
|
break;
|
2010-09-29 10:03:38 -07:00
|
|
|
case ECORE_X_WINDOW_STATE_ABOVE:
|
2012-12-05 13:15:42 -08:00
|
|
|
edata->state.above = 1;
|
2012-02-27 22:43:59 -08:00
|
|
|
break;
|
2010-09-29 10:03:38 -07:00
|
|
|
case ECORE_X_WINDOW_STATE_BELOW:
|
2012-12-05 13:15:42 -08:00
|
|
|
edata->state.below = 1;
|
2012-02-27 22:43:59 -08:00
|
|
|
break;
|
2010-09-29 10:03:38 -07:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
free(state);
|
|
|
|
}
|
2012-02-28 02:46:38 -08:00
|
|
|
if (
|
2012-12-05 13:15:42 -08:00
|
|
|
// (prev.x.modal != edata->state.modal) ||
|
|
|
|
(prev.x.sticky != edata->state.sticky) ||
|
|
|
|
(prev.x.maximized_v != edata->state.maximized_v) ||
|
|
|
|
(prev.x.maximized_h != edata->state.maximized_h) ||
|
|
|
|
// (prev.x.shaded != edata->state.shaded) ||
|
2014-11-23 05:01:34 -08:00
|
|
|
(prev.x.skip_taskbar != edata->state.skip_taskbar) ||
|
|
|
|
(prev.x.skip_pager != edata->state.skip_pager) ||
|
2012-12-05 13:15:42 -08:00
|
|
|
(prev.x.fullscreen != edata->state.fullscreen) ||
|
|
|
|
// (prev.x.above != edata->state.above) ||
|
|
|
|
// (prev.x.below != edata->state.below) ||
|
2012-02-28 02:46:38 -08:00
|
|
|
// (prev.prop.modal != ee->prop.modal) ||
|
|
|
|
(prev.prop.maximized != ee->prop.maximized) ||
|
|
|
|
(prev.prop.sticky != ee->prop.sticky) ||
|
|
|
|
(prev.prop.fullscreen != ee->prop.fullscreen) ||
|
|
|
|
(prev.prop.focus_skip != ee->prop.focus_skip))
|
|
|
|
state_change = 1;
|
2012-02-27 22:43:59 -08:00
|
|
|
}
|
|
|
|
else if (e->atom == ECORE_X_ATOM_WM_STATE)
|
|
|
|
{
|
|
|
|
Ecore_X_Window_State_Hint state;
|
2013-01-10 03:23:10 -08:00
|
|
|
|
2012-02-27 22:43:59 -08:00
|
|
|
// handle WM_STATE changes
|
|
|
|
state = ecore_x_icccm_state_get(e->win);
|
|
|
|
switch (state)
|
2010-09-29 10:03:38 -07:00
|
|
|
{
|
2012-02-27 22:43:59 -08:00
|
|
|
case ECORE_X_WINDOW_STATE_HINT_WITHDRAWN:
|
2012-02-28 02:46:38 -08:00
|
|
|
if ((!ee->prop.withdrawn) || (ee->prop.iconified))
|
|
|
|
{
|
|
|
|
state_change = 1;
|
2014-01-12 21:26:36 -08:00
|
|
|
ee->prop.withdrawn = EINA_TRUE;
|
2014-01-11 01:19:43 -08:00
|
|
|
ee->prop.iconified = EINA_FALSE;
|
2012-02-28 02:46:38 -08:00
|
|
|
}
|
|
|
|
break;
|
2012-02-27 22:43:59 -08:00
|
|
|
case ECORE_X_WINDOW_STATE_HINT_ICONIC:
|
2012-02-28 02:46:38 -08:00
|
|
|
if ((!ee->prop.iconified) || (ee->prop.withdrawn))
|
2012-02-27 22:43:59 -08:00
|
|
|
{
|
|
|
|
state_change = 1;
|
2014-01-11 01:19:43 -08:00
|
|
|
ee->prop.iconified = EINA_TRUE;
|
2014-01-12 21:26:36 -08:00
|
|
|
ee->prop.withdrawn = EINA_FALSE;
|
2012-02-27 22:43:59 -08:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case ECORE_X_WINDOW_STATE_HINT_NORMAL:
|
2012-02-28 02:46:38 -08:00
|
|
|
if ((ee->prop.iconified) || (ee->prop.withdrawn))
|
2012-02-27 22:43:59 -08:00
|
|
|
{
|
|
|
|
state_change = 1;
|
2014-01-11 01:19:43 -08:00
|
|
|
ee->prop.iconified = EINA_FALSE;
|
2014-01-12 21:26:36 -08:00
|
|
|
ee->prop.withdrawn = EINA_FALSE;
|
2012-02-27 22:43:59 -08:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
2010-09-29 10:03:38 -07:00
|
|
|
}
|
2006-07-27 09:14:33 -07:00
|
|
|
}
|
2012-02-27 22:43:59 -08:00
|
|
|
if (state_change)
|
|
|
|
{
|
|
|
|
if (ee->func.fn_state_change) ee->func.fn_state_change(ee);
|
|
|
|
}
|
Here is ecore_x with XCB backend.
* The XCB backend is disabled by default during the
configuration. To enable it, add --enable-ecore-x-xcb. See the
messages that configure displays when it finishes.
* The way XCB is detected, and used in src/lib/ecore_x/Makefile.am
should be improved
* Any program that uses ecore_evas does not need to be modified.
Any program that uses ecore_x may need some changes. That is,
adding some functions (_prefetch and _fetch ones). No other
change is needed. See the documention of any _get functions, as
these are the ones that need those functions.
* There are some missing parts, especially everything that involves
the keyboard, as porting Xlib functions related to strings (utf8
stuff, XKeysymToString, etc...) is an horror. So keyboard events
are not working yet.
* I tried to write as much documentation as I could. But there is
certainly some missing doc here and there.
there are certainly other things that I have forgotten.
Improvements of that backend:
* the creation of an ecore_evas is faster. Especially when done over
an ssh connection (on my computer, 7-10s with Xlib, 1.5s with XCB,
over an ssh)
* A Window Manager should be more responsive. But it's not tomorrow
that e17 will use it :)
Have fun !
SVN revision: 29500
2007-04-13 10:15:19 -07:00
|
|
|
|
2010-06-24 09:15:56 -07:00
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
2006-07-26 19:42:41 -07:00
|
|
|
}
|
|
|
|
|
2010-06-24 09:15:56 -07:00
|
|
|
static Eina_Bool
|
2012-11-25 01:55:32 -08:00
|
|
|
_ecore_evas_x_event_visibility_change(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
2007-09-27 08:31:00 -07:00
|
|
|
{
|
|
|
|
Ecore_Evas *ee;
|
|
|
|
Ecore_X_Event_Window_Visibility_Change *e;
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Engine_Data_X11 *edata;
|
2007-09-27 08:31:00 -07:00
|
|
|
|
|
|
|
e = event;
|
2009-03-19 06:06:16 -07:00
|
|
|
ee = ecore_event_window_match(e->win);
|
2010-06-24 09:15:56 -07:00
|
|
|
if (!ee) return ECORE_CALLBACK_PASS_ON; /* pass on event */
|
2012-12-05 13:15:42 -08:00
|
|
|
edata = ee->engine.data;
|
2010-06-24 09:15:56 -07:00
|
|
|
if (e->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
|
2007-09-27 08:31:00 -07:00
|
|
|
// printf("VIS CHANGE OBSCURED: %p %i\n", ee, e->fully_obscured);
|
2009-09-02 05:48:56 -07:00
|
|
|
if (e->fully_obscured)
|
|
|
|
{
|
|
|
|
/* FIXME: round trip */
|
2012-12-05 13:15:42 -08:00
|
|
|
if (!ecore_x_screen_is_composited(edata->screen_num))
|
2009-09-02 05:48:56 -07:00
|
|
|
ee->draw_ok = 0;
|
|
|
|
}
|
2011-09-21 23:02:26 -07:00
|
|
|
else
|
2011-07-26 04:24:10 -07:00
|
|
|
ee->draw_ok = 1;
|
2010-06-24 09:15:56 -07:00
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
2007-09-27 08:31:00 -07:00
|
|
|
}
|
|
|
|
|
2010-06-24 09:15:56 -07:00
|
|
|
static Eina_Bool
|
2012-11-25 01:55:32 -08:00
|
|
|
_ecore_evas_x_event_client_message(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
2010-02-01 06:13:48 -08:00
|
|
|
{
|
|
|
|
Ecore_Evas *ee;
|
|
|
|
Ecore_X_Event_Client_Message *e;
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Engine_Data_X11 *edata;
|
2010-02-01 06:13:48 -08:00
|
|
|
|
|
|
|
e = event;
|
2010-06-24 09:15:56 -07:00
|
|
|
if (e->format != 32) return ECORE_CALLBACK_PASS_ON;
|
2010-02-01 06:13:48 -08:00
|
|
|
if (e->message_type == ECORE_X_ATOM_E_COMP_SYNC_BEGIN)
|
|
|
|
{
|
|
|
|
ee = ecore_event_window_match(e->data.l[0]);
|
2010-06-24 09:15:56 -07:00
|
|
|
if (!ee) return ECORE_CALLBACK_PASS_ON; /* pass on event */
|
2014-01-11 01:19:43 -08:00
|
|
|
edata = ee->engine.data;
|
2011-09-21 23:02:26 -07:00
|
|
|
if (e->data.l[0] != (long)ee->prop.window)
|
2011-07-26 04:24:10 -07:00
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
2012-12-05 13:15:42 -08:00
|
|
|
if (!edata->sync_began)
|
2010-08-24 02:26:34 -07:00
|
|
|
{
|
|
|
|
// qeue a damage + draw. work around an event re-ordering thing.
|
2010-09-29 10:03:38 -07:00
|
|
|
evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
|
2010-08-24 02:26:34 -07:00
|
|
|
}
|
2012-12-05 13:15:42 -08:00
|
|
|
edata->sync_began = 1;
|
|
|
|
edata->sync_cancel = 0;
|
2010-02-01 06:13:48 -08:00
|
|
|
}
|
|
|
|
else if (e->message_type == ECORE_X_ATOM_E_COMP_SYNC_END)
|
|
|
|
{
|
|
|
|
ee = ecore_event_window_match(e->data.l[0]);
|
2010-06-24 09:15:56 -07:00
|
|
|
if (!ee) return ECORE_CALLBACK_PASS_ON; /* pass on event */
|
2014-01-11 01:19:43 -08:00
|
|
|
edata = ee->engine.data;
|
2011-09-21 23:02:26 -07:00
|
|
|
if (e->data.l[0] != (long)ee->prop.window)
|
2011-07-26 04:24:10 -07:00
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
2012-12-05 13:15:42 -08:00
|
|
|
edata->sync_began = 0;
|
|
|
|
edata->sync_cancel = 0;
|
2010-02-01 06:13:48 -08:00
|
|
|
}
|
|
|
|
else if (e->message_type == ECORE_X_ATOM_E_COMP_SYNC_CANCEL)
|
|
|
|
{
|
|
|
|
ee = ecore_event_window_match(e->data.l[0]);
|
2010-06-24 09:15:56 -07:00
|
|
|
if (!ee) return ECORE_CALLBACK_PASS_ON; /* pass on event */
|
2014-01-11 01:19:43 -08:00
|
|
|
edata = ee->engine.data;
|
2011-09-21 23:02:26 -07:00
|
|
|
if (e->data.l[0] != (long)ee->prop.window)
|
2011-07-26 04:24:10 -07:00
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
2012-12-05 13:15:42 -08:00
|
|
|
edata->sync_began = 0;
|
|
|
|
edata->sync_cancel = 1;
|
2010-02-01 06:13:48 -08:00
|
|
|
}
|
2011-03-30 03:10:04 -07:00
|
|
|
else if ((e->message_type == ECORE_X_ATOM_WM_PROTOCOLS) &&
|
|
|
|
(e->data.l[0] == (int)ECORE_X_ATOM_NET_WM_SYNC_REQUEST))
|
|
|
|
{
|
|
|
|
ee = ecore_event_window_match(e->win);
|
|
|
|
if (!ee) return ECORE_CALLBACK_PASS_ON; /* pass on event */
|
2014-01-11 01:19:43 -08:00
|
|
|
edata = ee->engine.data;
|
2012-12-05 13:15:42 -08:00
|
|
|
edata->netwm_sync_val_lo = (unsigned int)e->data.l[2];
|
|
|
|
edata->netwm_sync_val_hi = (int)e->data.l[3];
|
|
|
|
edata->netwm_sync_set = 1;
|
2011-03-30 03:10:04 -07:00
|
|
|
}
|
2013-01-20 16:22:35 -08:00
|
|
|
else if (e->message_type == ECORE_X_ATOM_E_WINDOW_PROFILE_CHANGE_REQUEST)
|
2012-12-04 22:48:46 -08:00
|
|
|
{
|
|
|
|
ee = ecore_event_window_match(e->win);
|
|
|
|
if (!ee) return ECORE_CALLBACK_PASS_ON; /* pass on event */
|
2014-01-11 01:19:43 -08:00
|
|
|
edata = ee->engine.data;
|
2012-12-04 22:48:46 -08:00
|
|
|
if (ee->profile_supported)
|
|
|
|
{
|
|
|
|
char *p = ecore_x_atom_name_get(e->data.l[1]);
|
|
|
|
if (p)
|
|
|
|
{
|
|
|
|
_ecore_evas_window_profile_free(ee);
|
|
|
|
ee->prop.profile.name = (char *)eina_stringshare_add(p);
|
|
|
|
|
|
|
|
/* window profiles of each sub_ecore_evas will be changed
|
|
|
|
* in fn_state_change callback.
|
|
|
|
*/
|
|
|
|
if (ee->func.fn_state_change)
|
|
|
|
ee->func.fn_state_change(ee);
|
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
edata->profile.done = 1;
|
2012-12-04 22:48:46 -08:00
|
|
|
free(p);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2013-02-15 01:32:40 -08:00
|
|
|
else if (e->message_type == ECORE_X_ATOM_E_ILLUME_ACCESS_CONTROL)
|
2014-01-11 01:19:43 -08:00
|
|
|
{
|
|
|
|
///TODO after access structure determined
|
|
|
|
// if (ee->func.fn_msg_handle)
|
|
|
|
// ee->func.fn_msg_handle(ee, msg_domain, msg_id, data, size);
|
2013-03-06 23:33:59 -08:00
|
|
|
}
|
|
|
|
else if (e->message_type == ECORE_X_ATOM_E_DEICONIFY_APPROVE)
|
|
|
|
{
|
|
|
|
ee = ecore_event_window_match(e->win);
|
|
|
|
if (!ee) return ECORE_CALLBACK_PASS_ON; /* pass on event */
|
2013-03-11 19:53:21 -07:00
|
|
|
if (e->data.l[1] != 0) //wm sends request message using value 0
|
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
2013-03-06 23:33:59 -08:00
|
|
|
|
|
|
|
if (ecore_evas_manual_render_get(ee))
|
|
|
|
ecore_evas_manual_render(ee);
|
2013-03-11 19:53:21 -07:00
|
|
|
//client sends reply message using value 1
|
2013-03-06 23:33:59 -08:00
|
|
|
ecore_x_client_message32_send(e->win, ECORE_X_ATOM_E_DEICONIFY_APPROVE,
|
|
|
|
ECORE_X_EVENT_MASK_WINDOW_CONFIGURE,
|
|
|
|
e->win, 1,
|
|
|
|
0, 0, 0);
|
2014-01-11 01:19:43 -08:00
|
|
|
}
|
2014-02-08 16:46:51 -08:00
|
|
|
else if (e->message_type == ECORE_X_ATOM_E_WINDOW_ROTATION_CHANGE_PREPARE)
|
|
|
|
{
|
|
|
|
ee = ecore_event_window_match(e->data.l[0]);
|
|
|
|
if (!ee) return ECORE_CALLBACK_PASS_ON; /* pass on event */
|
|
|
|
edata = ee->engine.data;
|
|
|
|
if (e->data.l[0] != (long)ee->prop.window)
|
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
|
|
|
if (ee->prop.wm_rot.supported)
|
|
|
|
{
|
|
|
|
if (ee->prop.wm_rot.app_set)
|
|
|
|
{
|
|
|
|
ee->prop.wm_rot.angle = (int)e->data.l[1];
|
|
|
|
ee->prop.wm_rot.win_resize = (int)e->data.l[2];
|
|
|
|
ee->prop.wm_rot.w = (int)e->data.l[3];
|
|
|
|
ee->prop.wm_rot.h = (int)e->data.l[4];
|
|
|
|
if (ee->prop.wm_rot.win_resize)
|
|
|
|
edata->wm_rot.configure_coming = 1;
|
|
|
|
edata->wm_rot.prepare = 1;
|
|
|
|
edata->wm_rot.request = 0;
|
|
|
|
edata->wm_rot.done = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (e->message_type == ECORE_X_ATOM_E_WINDOW_ROTATION_CHANGE_REQUEST)
|
|
|
|
{
|
|
|
|
ee = ecore_event_window_match(e->data.l[0]);
|
|
|
|
if (!ee) return ECORE_CALLBACK_PASS_ON; /* pass on event */
|
|
|
|
edata = ee->engine.data;
|
|
|
|
if (e->data.l[0] != (long)ee->prop.window)
|
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
|
|
|
if (ee->prop.wm_rot.supported)
|
|
|
|
{
|
|
|
|
if (ee->prop.wm_rot.app_set)
|
|
|
|
{
|
|
|
|
edata->wm_rot.prepare = 0;
|
|
|
|
edata->wm_rot.request = 1;
|
|
|
|
edata->wm_rot.done = 0;
|
|
|
|
if (ee->prop.wm_rot.win_resize)
|
|
|
|
{
|
|
|
|
if ((ee->w == ee->prop.wm_rot.w) &&
|
|
|
|
(ee->h == ee->prop.wm_rot.h))
|
|
|
|
{
|
|
|
|
edata->wm_rot.configure_coming = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!edata->wm_rot.configure_coming)
|
|
|
|
{
|
|
|
|
if (ee->prop.wm_rot.manual_mode.set)
|
|
|
|
{
|
|
|
|
ee->prop.wm_rot.manual_mode.wait_for_done = EINA_TRUE;
|
|
|
|
_ecore_evas_x_wm_rot_manual_rotation_done_timeout_update(ee);
|
|
|
|
}
|
|
|
|
_ecore_evas_x_rotation_set(ee, ee->prop.wm_rot.angle, 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2014-02-27 14:20:01 -08:00
|
|
|
else if (e->message_type == ECORE_X_ATOM_E_WINDOW_AUX_HINT_ALLOWED)
|
|
|
|
{
|
|
|
|
ee = ecore_event_window_match(e->win);
|
|
|
|
if (!ee) return ECORE_CALLBACK_PASS_ON; /* pass on event */
|
|
|
|
|
|
|
|
int id = e->data.l[1]; /* id of aux hint */
|
|
|
|
Eina_List *l;
|
|
|
|
Ecore_Evas_Aux_Hint *aux;
|
|
|
|
EINA_LIST_FOREACH(ee->prop.aux_hint.hints, l, aux)
|
|
|
|
{
|
|
|
|
if (id == aux->id)
|
|
|
|
{
|
|
|
|
aux->allowed = 1;
|
|
|
|
if (!aux->notified)
|
|
|
|
{
|
|
|
|
if (ee->func.fn_state_change) ee->func.fn_state_change(ee);
|
|
|
|
aux->notified = 1;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2010-06-24 09:15:56 -07:00
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
2010-02-01 06:13:48 -08:00
|
|
|
}
|
|
|
|
|
2013-10-18 03:23:38 -07:00
|
|
|
static Eina_Bool
|
|
|
|
_fake_out(void *data)
|
|
|
|
{
|
|
|
|
Ecore_Evas *ee = data;
|
|
|
|
Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
|
|
|
|
Ecore_X_Event_Mouse_Out *e = &(edata->out_ev);
|
2013-10-31 02:38:34 -07:00
|
|
|
|
2013-10-18 03:23:38 -07:00
|
|
|
edata->outdelay = NULL;
|
|
|
|
|
|
|
|
ecore_event_evas_modifier_lock_update(ee->evas, e->modifiers);
|
|
|
|
_ecore_evas_mouse_move_process(ee, e->x, e->y, e->time);
|
|
|
|
if (e->mode == ECORE_X_EVENT_MODE_GRAB)
|
|
|
|
evas_event_feed_mouse_cancel(ee->evas, e->time, NULL);
|
|
|
|
evas_event_feed_mouse_out(ee->evas, e->time, NULL);
|
|
|
|
if (ee->func.fn_mouse_out) ee->func.fn_mouse_out(ee);
|
|
|
|
if (ee->prop.cursor.object) evas_object_hide(ee->prop.cursor.object);
|
|
|
|
ee->in = EINA_FALSE;
|
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
2010-06-24 09:15:56 -07:00
|
|
|
static Eina_Bool
|
2012-11-25 01:55:32 -08:00
|
|
|
_ecore_evas_x_event_mouse_in(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
|
|
|
Ecore_Evas *ee;
|
|
|
|
Ecore_X_Event_Mouse_In *e;
|
2013-10-18 03:23:38 -07:00
|
|
|
Ecore_Evas_Engine_Data_X11 *edata;
|
Here is ecore_x with XCB backend.
* The XCB backend is disabled by default during the
configuration. To enable it, add --enable-ecore-x-xcb. See the
messages that configure displays when it finishes.
* The way XCB is detected, and used in src/lib/ecore_x/Makefile.am
should be improved
* Any program that uses ecore_evas does not need to be modified.
Any program that uses ecore_x may need some changes. That is,
adding some functions (_prefetch and _fetch ones). No other
change is needed. See the documention of any _get functions, as
these are the ones that need those functions.
* There are some missing parts, especially everything that involves
the keyboard, as porting Xlib functions related to strings (utf8
stuff, XKeysymToString, etc...) is an horror. So keyboard events
are not working yet.
* I tried to write as much documentation as I could. But there is
certainly some missing doc here and there.
there are certainly other things that I have forgotten.
Improvements of that backend:
* the creation of an ecore_evas is faster. Especially when done over
an ssh connection (on my computer, 7-10s with Xlib, 1.5s with XCB,
over an ssh)
* A Window Manager should be more responsive. But it's not tomorrow
that e17 will use it :)
Have fun !
SVN revision: 29500
2007-04-13 10:15:19 -07:00
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
e = event;
|
2010-10-19 06:56:17 -07:00
|
|
|
ee = ecore_event_window_match(e->win);
|
2010-06-24 09:15:56 -07:00
|
|
|
if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON; /* pass on event */
|
|
|
|
if (e->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
|
2013-10-18 03:23:38 -07:00
|
|
|
edata = ee->engine.data;
|
|
|
|
/*
|
|
|
|
{
|
|
|
|
time_t t;
|
|
|
|
char *ct;
|
|
|
|
|
|
|
|
const char *modes[] = {
|
|
|
|
"MODE_NORMAL",
|
|
|
|
"MODE_WHILE_GRABBED",
|
|
|
|
"MODE_GRAB",
|
|
|
|
"MODE_UNGRAB"
|
|
|
|
};
|
|
|
|
const char *details[] = {
|
|
|
|
"DETAIL_ANCESTOR",
|
|
|
|
"DETAIL_VIRTUAL",
|
|
|
|
"DETAIL_INFERIOR",
|
|
|
|
"DETAIL_NON_LINEAR",
|
|
|
|
"DETAIL_NON_LINEAR_VIRTUAL",
|
|
|
|
"DETAIL_POINTER",
|
|
|
|
"DETAIL_POINTER_ROOT",
|
|
|
|
"DETAIL_DETAIL_NONE"
|
|
|
|
};
|
|
|
|
t = time(NULL);
|
|
|
|
ct = ctime(&t);
|
|
|
|
ct[strlen(ct) - 1] = 0;
|
|
|
|
printf("@@ ->IN 0x%x 0x%x %s md=%s dt=%s\n",
|
|
|
|
e->win, e->event_win,
|
|
|
|
ct,
|
|
|
|
modes[e->mode],
|
|
|
|
details[e->detail]);
|
|
|
|
}
|
|
|
|
*/
|
2010-09-08 04:23:42 -07:00
|
|
|
// disable. causes more problems than it fixes
|
2009-03-16 09:24:43 -07:00
|
|
|
// if ((e->mode == ECORE_X_EVENT_MODE_GRAB) ||
|
|
|
|
// (e->mode == ECORE_X_EVENT_MODE_UNGRAB))
|
|
|
|
// return 0;
|
2013-10-18 03:23:38 -07:00
|
|
|
|
|
|
|
// handle click to focus passive buton grab side-effects
|
|
|
|
if ((e->mode == ECORE_X_EVENT_MODE_UNGRAB) &&
|
|
|
|
(e->detail == ECORE_X_EVENT_DETAIL_ANCESTOR) &&
|
|
|
|
(edata->outdelay))
|
|
|
|
{
|
|
|
|
ecore_timer_del(edata->outdelay);
|
|
|
|
edata->outdelay = NULL;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
if (edata->outdelay)
|
|
|
|
{
|
|
|
|
ecore_timer_del(edata->outdelay);
|
|
|
|
edata->outdelay = NULL;
|
|
|
|
_fake_out(ee);
|
|
|
|
}
|
|
|
|
|
2009-03-16 09:24:43 -07:00
|
|
|
/* if (e->mode != ECORE_X_EVENT_MODE_NORMAL) return 0; */
|
2011-12-27 04:02:18 -08:00
|
|
|
if (!ee->in)
|
|
|
|
{
|
|
|
|
if (ee->func.fn_mouse_in) ee->func.fn_mouse_in(ee);
|
|
|
|
ecore_event_evas_modifier_lock_update(ee->evas, e->modifiers);
|
|
|
|
evas_event_feed_mouse_in(ee->evas, e->time, NULL);
|
|
|
|
_ecore_evas_mouse_move_process(ee, e->x, e->y, e->time);
|
|
|
|
ee->in = EINA_TRUE;
|
|
|
|
}
|
2010-06-24 09:15:56 -07:00
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
2003-09-23 01:09:32 -07:00
|
|
|
}
|
|
|
|
|
2010-06-24 09:15:56 -07:00
|
|
|
static Eina_Bool
|
2012-11-25 01:55:32 -08:00
|
|
|
_ecore_evas_x_event_mouse_out(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
|
|
|
Ecore_Evas *ee;
|
|
|
|
Ecore_X_Event_Mouse_Out *e;
|
2013-10-18 03:23:38 -07:00
|
|
|
Ecore_Evas_Engine_Data_X11 *edata;
|
Here is ecore_x with XCB backend.
* The XCB backend is disabled by default during the
configuration. To enable it, add --enable-ecore-x-xcb. See the
messages that configure displays when it finishes.
* The way XCB is detected, and used in src/lib/ecore_x/Makefile.am
should be improved
* Any program that uses ecore_evas does not need to be modified.
Any program that uses ecore_x may need some changes. That is,
adding some functions (_prefetch and _fetch ones). No other
change is needed. See the documention of any _get functions, as
these are the ones that need those functions.
* There are some missing parts, especially everything that involves
the keyboard, as porting Xlib functions related to strings (utf8
stuff, XKeysymToString, etc...) is an horror. So keyboard events
are not working yet.
* I tried to write as much documentation as I could. But there is
certainly some missing doc here and there.
there are certainly other things that I have forgotten.
Improvements of that backend:
* the creation of an ecore_evas is faster. Especially when done over
an ssh connection (on my computer, 7-10s with Xlib, 1.5s with XCB,
over an ssh)
* A Window Manager should be more responsive. But it's not tomorrow
that e17 will use it :)
Have fun !
SVN revision: 29500
2007-04-13 10:15:19 -07:00
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
e = event;
|
2010-10-19 06:56:17 -07:00
|
|
|
ee = ecore_event_window_match(e->win);
|
2010-06-24 09:15:56 -07:00
|
|
|
if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
|
2009-03-16 09:24:43 -07:00
|
|
|
/* pass on event */
|
2010-06-24 09:15:56 -07:00
|
|
|
if (e->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
|
2013-10-18 03:23:38 -07:00
|
|
|
edata = ee->engine.data;
|
|
|
|
/*
|
|
|
|
{
|
|
|
|
time_t t;
|
|
|
|
char *ct;
|
|
|
|
|
|
|
|
const char *modes[] = {
|
|
|
|
"MODE_NORMAL",
|
|
|
|
"MODE_WHILE_GRABBED",
|
|
|
|
"MODE_GRAB",
|
|
|
|
"MODE_UNGRAB"
|
|
|
|
};
|
|
|
|
const char *details[] = {
|
|
|
|
"DETAIL_ANCESTOR",
|
|
|
|
"DETAIL_VIRTUAL",
|
|
|
|
"DETAIL_INFERIOR",
|
|
|
|
"DETAIL_NON_LINEAR",
|
|
|
|
"DETAIL_NON_LINEAR_VIRTUAL",
|
|
|
|
"DETAIL_POINTER",
|
|
|
|
"DETAIL_POINTER_ROOT",
|
|
|
|
"DETAIL_DETAIL_NONE"
|
|
|
|
};
|
|
|
|
t = time(NULL);
|
|
|
|
ct = ctime(&t);
|
|
|
|
ct[strlen(ct) - 1] = 0;
|
|
|
|
printf("@@ ->OUT 0x%x 0x%x %s md=%s dt=%s\n",
|
|
|
|
e->win, e->event_win,
|
|
|
|
ct,
|
|
|
|
modes[e->mode],
|
|
|
|
details[e->detail]);
|
|
|
|
}
|
|
|
|
*/
|
2009-03-16 09:24:43 -07:00
|
|
|
// disable. causes more problems than it fixes
|
|
|
|
// if ((e->mode == ECORE_X_EVENT_MODE_GRAB) ||
|
|
|
|
// (e->mode == ECORE_X_EVENT_MODE_UNGRAB))
|
|
|
|
// return 0;
|
2013-10-18 03:23:38 -07:00
|
|
|
|
|
|
|
// click to focus mouse out+in work-around
|
|
|
|
if ((e->mode == ECORE_X_EVENT_MODE_GRAB) &&
|
|
|
|
(e->detail == ECORE_X_EVENT_DETAIL_ANCESTOR))
|
|
|
|
{
|
|
|
|
// defer out handling in case its a "fake" out thanks to click
|
|
|
|
// to focus (which gets us another out soon after
|
|
|
|
if (edata->outdelay) ecore_timer_del(edata->outdelay);
|
|
|
|
edata->out_ev = *e;
|
|
|
|
edata->outdelay = ecore_timer_add(0.05, _fake_out, ee);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
if (edata->outdelay)
|
|
|
|
{
|
|
|
|
ecore_timer_del(edata->outdelay);
|
|
|
|
edata->outdelay = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
// if (e->mode != ECORE_X_EVENT_MODE_NORMAL) return 0;
|
2011-12-27 19:07:39 -08:00
|
|
|
// printf("OUT: ee->in=%i, e->mode=%i, e->detail=%i, dount_count=%i\n",
|
|
|
|
// ee->in, e->mode, e->detail, evas_event_down_count_get(ee->evas));
|
2011-12-27 04:02:18 -08:00
|
|
|
if (ee->in)
|
|
|
|
{
|
2011-12-27 19:07:39 -08:00
|
|
|
if ((evas_event_down_count_get(ee->evas) > 0) &&
|
|
|
|
(!((e->mode == ECORE_X_EVENT_MODE_GRAB) &&
|
|
|
|
(e->detail == ECORE_X_EVENT_DETAIL_NON_LINEAR))))
|
2011-12-27 04:02:18 -08:00
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
|
|
|
ecore_event_evas_modifier_lock_update(ee->evas, e->modifiers);
|
|
|
|
_ecore_evas_mouse_move_process(ee, e->x, e->y, e->time);
|
|
|
|
if (e->mode == ECORE_X_EVENT_MODE_GRAB)
|
|
|
|
evas_event_feed_mouse_cancel(ee->evas, e->time, NULL);
|
|
|
|
evas_event_feed_mouse_out(ee->evas, e->time, NULL);
|
|
|
|
if (ee->func.fn_mouse_out) ee->func.fn_mouse_out(ee);
|
|
|
|
if (ee->prop.cursor.object) evas_object_hide(ee->prop.cursor.object);
|
|
|
|
ee->in = EINA_FALSE;
|
|
|
|
}
|
2010-06-24 09:15:56 -07:00
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
2003-09-23 01:09:32 -07:00
|
|
|
}
|
|
|
|
|
2010-06-24 09:15:56 -07:00
|
|
|
static Eina_Bool
|
2012-11-25 01:55:32 -08:00
|
|
|
_ecore_evas_x_event_window_focus_in(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
|
|
|
Ecore_Evas *ee;
|
|
|
|
Ecore_X_Event_Window_Focus_In *e;
|
Here is ecore_x with XCB backend.
* The XCB backend is disabled by default during the
configuration. To enable it, add --enable-ecore-x-xcb. See the
messages that configure displays when it finishes.
* The way XCB is detected, and used in src/lib/ecore_x/Makefile.am
should be improved
* Any program that uses ecore_evas does not need to be modified.
Any program that uses ecore_x may need some changes. That is,
adding some functions (_prefetch and _fetch ones). No other
change is needed. See the documention of any _get functions, as
these are the ones that need those functions.
* There are some missing parts, especially everything that involves
the keyboard, as porting Xlib functions related to strings (utf8
stuff, XKeysymToString, etc...) is an horror. So keyboard events
are not working yet.
* I tried to write as much documentation as I could. But there is
certainly some missing doc here and there.
there are certainly other things that I have forgotten.
Improvements of that backend:
* the creation of an ecore_evas is faster. Especially when done over
an ssh connection (on my computer, 7-10s with Xlib, 1.5s with XCB,
over an ssh)
* A Window Manager should be more responsive. But it's not tomorrow
that e17 will use it :)
Have fun !
SVN revision: 29500
2007-04-13 10:15:19 -07:00
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
e = event;
|
2009-03-19 06:06:16 -07:00
|
|
|
ee = ecore_event_window_match(e->win);
|
2010-06-24 09:15:56 -07:00
|
|
|
if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON; /* pass on event */
|
|
|
|
if (e->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
|
2012-03-07 23:51:39 -08:00
|
|
|
//xx// filtering with these doesnt help
|
|
|
|
//xx// if (e->mode == ECORE_X_EVENT_MODE_UNGRAB) return ECORE_CALLBACK_PASS_ON;
|
2014-01-11 01:19:43 -08:00
|
|
|
ee->prop.focused = EINA_TRUE;
|
2010-02-01 06:13:48 -08:00
|
|
|
evas_focus_in(ee->evas);
|
2003-09-23 01:09:32 -07:00
|
|
|
if (ee->func.fn_focus_in) ee->func.fn_focus_in(ee);
|
2010-06-24 09:15:56 -07:00
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
2003-09-23 01:09:32 -07:00
|
|
|
}
|
|
|
|
|
2010-06-24 09:15:56 -07:00
|
|
|
static Eina_Bool
|
2012-11-25 01:55:32 -08:00
|
|
|
_ecore_evas_x_event_window_focus_out(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
|
|
|
Ecore_Evas *ee;
|
|
|
|
Ecore_X_Event_Window_Focus_Out *e;
|
Here is ecore_x with XCB backend.
* The XCB backend is disabled by default during the
configuration. To enable it, add --enable-ecore-x-xcb. See the
messages that configure displays when it finishes.
* The way XCB is detected, and used in src/lib/ecore_x/Makefile.am
should be improved
* Any program that uses ecore_evas does not need to be modified.
Any program that uses ecore_x may need some changes. That is,
adding some functions (_prefetch and _fetch ones). No other
change is needed. See the documention of any _get functions, as
these are the ones that need those functions.
* There are some missing parts, especially everything that involves
the keyboard, as porting Xlib functions related to strings (utf8
stuff, XKeysymToString, etc...) is an horror. So keyboard events
are not working yet.
* I tried to write as much documentation as I could. But there is
certainly some missing doc here and there.
there are certainly other things that I have forgotten.
Improvements of that backend:
* the creation of an ecore_evas is faster. Especially when done over
an ssh connection (on my computer, 7-10s with Xlib, 1.5s with XCB,
over an ssh)
* A Window Manager should be more responsive. But it's not tomorrow
that e17 will use it :)
Have fun !
SVN revision: 29500
2007-04-13 10:15:19 -07:00
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
e = event;
|
2009-03-19 06:06:16 -07:00
|
|
|
ee = ecore_event_window_match(e->win);
|
2010-06-24 09:15:56 -07:00
|
|
|
if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON; /* pass on event */
|
|
|
|
if (e->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
|
2012-03-07 23:51:39 -08:00
|
|
|
//xx// filtering with these doesnt help
|
|
|
|
//xx// if (e->mode == ECORE_X_EVENT_MODE_GRAB) return ECORE_CALLBACK_PASS_ON;
|
|
|
|
|
2010-02-01 06:13:48 -08:00
|
|
|
// if (ee->prop.fullscreen)
|
|
|
|
// ecore_x_window_focus(ee->prop.window);
|
|
|
|
evas_focus_out(ee->evas);
|
2014-01-11 01:19:43 -08:00
|
|
|
ee->prop.focused = EINA_FALSE;
|
2003-09-23 01:09:32 -07:00
|
|
|
if (ee->func.fn_focus_out) ee->func.fn_focus_out(ee);
|
2010-06-24 09:15:56 -07:00
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
2003-09-23 01:09:32 -07:00
|
|
|
}
|
|
|
|
|
2010-06-24 09:15:56 -07:00
|
|
|
static Eina_Bool
|
2012-11-25 01:55:32 -08:00
|
|
|
_ecore_evas_x_event_window_damage(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
|
|
|
Ecore_Evas *ee;
|
|
|
|
Ecore_X_Event_Window_Damage *e;
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Engine_Data_X11 *edata;
|
2003-09-23 01:09:32 -07:00
|
|
|
|
|
|
|
e = event;
|
2009-03-19 06:06:16 -07:00
|
|
|
ee = ecore_event_window_match(e->win);
|
2010-06-24 09:15:56 -07:00
|
|
|
if (!ee) return ECORE_CALLBACK_PASS_ON; /* pass on event */
|
2012-12-05 13:15:42 -08:00
|
|
|
edata = ee->engine.data;
|
2010-06-24 09:15:56 -07:00
|
|
|
if (e->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
|
2012-12-05 13:15:42 -08:00
|
|
|
if (edata->using_bg_pixmap) return ECORE_CALLBACK_PASS_ON;
|
2007-09-27 08:31:00 -07:00
|
|
|
// printf("EXPOSE %p [%i] %i %i %ix%i\n", ee, ee->prop.avoid_damage, e->x, e->y, e->w, e->h);
|
2003-09-23 01:09:32 -07:00
|
|
|
if (ee->prop.avoid_damage)
|
|
|
|
{
|
2010-09-29 10:03:38 -07:00
|
|
|
Ecore_X_Rectangle rect;
|
2011-07-26 04:24:10 -07:00
|
|
|
Ecore_X_XRegion *tmpr;
|
2010-09-29 10:03:38 -07:00
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
if (!edata->damages)
|
|
|
|
edata->damages = ecore_x_xregion_new();
|
2010-09-29 10:03:38 -07:00
|
|
|
tmpr = ecore_x_xregion_new();
|
|
|
|
rect.x = e->x;
|
|
|
|
rect.y = e->y;
|
|
|
|
rect.width = e->w;
|
|
|
|
rect.height = e->h;
|
2012-12-05 13:15:42 -08:00
|
|
|
ecore_x_xregion_union_rect(tmpr, edata->damages, &rect);
|
|
|
|
ecore_x_xregion_free(edata->damages);
|
|
|
|
edata->damages = tmpr;
|
2007-04-13 21:20:23 -07:00
|
|
|
/* no - this breaks things badly. disable. Ecore_X_Rectangle != XRectangle - see
|
|
|
|
* the typedefs in x's headers and ecore_x's. also same with Region - it's a pointer in x - not an X ID
|
2010-09-29 10:03:38 -07:00
|
|
|
Ecore_X_Rectangle rect;
|
|
|
|
Ecore_X_XRegion *tmpr;
|
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
if (!edata->damages) edata->damages = ecore_x_xregion_new();
|
2010-09-29 10:03:38 -07:00
|
|
|
tmpr = ecore_x_xregion_new();
|
|
|
|
rect.x = e->x;
|
|
|
|
rect.y = e->y;
|
|
|
|
rect.width = e->w;
|
|
|
|
rect.height = e->h;
|
2012-12-05 13:15:42 -08:00
|
|
|
ecore_x_xregion_union_rect(tmpr, edata->damages, &rect);
|
|
|
|
ecore_x_xregion_free(edata->damages);
|
|
|
|
edata->damages = tmpr;
|
2007-04-13 21:20:23 -07:00
|
|
|
*/
|
2003-09-23 01:09:32 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-09-29 10:03:38 -07:00
|
|
|
if (ee->rotation == 0)
|
2011-07-26 04:24:10 -07:00
|
|
|
evas_damage_rectangle_add(ee->evas, e->x, e->y, e->w, e->h);
|
2010-09-29 10:03:38 -07:00
|
|
|
else if (ee->rotation == 90)
|
|
|
|
evas_damage_rectangle_add(ee->evas,
|
2011-07-26 04:24:10 -07:00
|
|
|
ee->h - e->y - e->h, e->x, e->h, e->w);
|
2010-09-29 10:03:38 -07:00
|
|
|
else if (ee->rotation == 180)
|
2011-07-26 04:24:10 -07:00
|
|
|
evas_damage_rectangle_add(ee->evas, ee->w - e->x - e->w,
|
|
|
|
ee->h - e->y - e->h, e->w, e->h);
|
2010-09-29 10:03:38 -07:00
|
|
|
else if (ee->rotation == 270)
|
2011-07-26 04:24:10 -07:00
|
|
|
evas_damage_rectangle_add(ee->evas, e->y, ee->w - e->x - e->w,
|
2010-09-29 10:03:38 -07:00
|
|
|
e->h, e->w);
|
2003-09-23 01:09:32 -07:00
|
|
|
}
|
2010-06-24 09:15:56 -07:00
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
2003-09-23 01:09:32 -07:00
|
|
|
}
|
|
|
|
|
2010-06-24 09:15:56 -07:00
|
|
|
static Eina_Bool
|
2012-11-25 01:55:32 -08:00
|
|
|
_ecore_evas_x_event_window_destroy(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
|
|
|
Ecore_Evas *ee;
|
|
|
|
Ecore_X_Event_Window_Destroy *e;
|
2013-07-24 05:58:57 -07:00
|
|
|
Ecore_Evas_Engine_Data_X11 *edata;
|
Here is ecore_x with XCB backend.
* The XCB backend is disabled by default during the
configuration. To enable it, add --enable-ecore-x-xcb. See the
messages that configure displays when it finishes.
* The way XCB is detected, and used in src/lib/ecore_x/Makefile.am
should be improved
* Any program that uses ecore_evas does not need to be modified.
Any program that uses ecore_x may need some changes. That is,
adding some functions (_prefetch and _fetch ones). No other
change is needed. See the documention of any _get functions, as
these are the ones that need those functions.
* There are some missing parts, especially everything that involves
the keyboard, as porting Xlib functions related to strings (utf8
stuff, XKeysymToString, etc...) is an horror. So keyboard events
are not working yet.
* I tried to write as much documentation as I could. But there is
certainly some missing doc here and there.
there are certainly other things that I have forgotten.
Improvements of that backend:
* the creation of an ecore_evas is faster. Especially when done over
an ssh connection (on my computer, 7-10s with Xlib, 1.5s with XCB,
over an ssh)
* A Window Manager should be more responsive. But it's not tomorrow
that e17 will use it :)
Have fun !
SVN revision: 29500
2007-04-13 10:15:19 -07:00
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
e = event;
|
2010-10-19 06:56:17 -07:00
|
|
|
ee = ecore_event_window_match(e->win);
|
2010-06-24 09:15:56 -07:00
|
|
|
if (!ee) return ECORE_CALLBACK_PASS_ON; /* pass on event */
|
|
|
|
if (e->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
|
2013-07-24 05:58:57 -07:00
|
|
|
edata = ee->engine.data;
|
2003-09-23 01:09:32 -07:00
|
|
|
if (ee->func.fn_destroy) ee->func.fn_destroy(ee);
|
2013-07-24 05:58:57 -07:00
|
|
|
edata->destroyed = 1;
|
2010-02-01 06:13:48 -08:00
|
|
|
_ecore_evas_x_sync_clear(ee);
|
2003-09-23 01:09:32 -07:00
|
|
|
ecore_evas_free(ee);
|
2010-06-24 09:15:56 -07:00
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
2003-09-23 01:09:32 -07:00
|
|
|
}
|
|
|
|
|
2010-06-24 09:15:56 -07:00
|
|
|
static Eina_Bool
|
2012-11-25 01:55:32 -08:00
|
|
|
_ecore_evas_x_event_window_configure(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
|
|
|
Ecore_Evas *ee;
|
|
|
|
Ecore_X_Event_Window_Configure *e;
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Engine_Data_X11 *edata;
|
Here is ecore_x with XCB backend.
* The XCB backend is disabled by default during the
configuration. To enable it, add --enable-ecore-x-xcb. See the
messages that configure displays when it finishes.
* The way XCB is detected, and used in src/lib/ecore_x/Makefile.am
should be improved
* Any program that uses ecore_evas does not need to be modified.
Any program that uses ecore_x may need some changes. That is,
adding some functions (_prefetch and _fetch ones). No other
change is needed. See the documention of any _get functions, as
these are the ones that need those functions.
* There are some missing parts, especially everything that involves
the keyboard, as porting Xlib functions related to strings (utf8
stuff, XKeysymToString, etc...) is an horror. So keyboard events
are not working yet.
* I tried to write as much documentation as I could. But there is
certainly some missing doc here and there.
there are certainly other things that I have forgotten.
Improvements of that backend:
* the creation of an ecore_evas is faster. Especially when done over
an ssh connection (on my computer, 7-10s with Xlib, 1.5s with XCB,
over an ssh)
* A Window Manager should be more responsive. But it's not tomorrow
that e17 will use it :)
Have fun !
SVN revision: 29500
2007-04-13 10:15:19 -07:00
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
e = event;
|
2010-10-19 06:56:17 -07:00
|
|
|
ee = ecore_event_window_match(e->win);
|
2010-06-24 09:15:56 -07:00
|
|
|
if (!ee) return ECORE_CALLBACK_PASS_ON; /* pass on event */
|
2012-12-05 13:15:42 -08:00
|
|
|
edata = ee->engine.data;
|
2010-06-24 09:15:56 -07:00
|
|
|
if (e->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
|
2012-12-05 13:15:42 -08:00
|
|
|
if (edata->direct_resize) return ECORE_CALLBACK_PASS_ON;
|
Here is ecore_x with XCB backend.
* The XCB backend is disabled by default during the
configuration. To enable it, add --enable-ecore-x-xcb. See the
messages that configure displays when it finishes.
* The way XCB is detected, and used in src/lib/ecore_x/Makefile.am
should be improved
* Any program that uses ecore_evas does not need to be modified.
Any program that uses ecore_x may need some changes. That is,
adding some functions (_prefetch and _fetch ones). No other
change is needed. See the documention of any _get functions, as
these are the ones that need those functions.
* There are some missing parts, especially everything that involves
the keyboard, as porting Xlib functions related to strings (utf8
stuff, XKeysymToString, etc...) is an horror. So keyboard events
are not working yet.
* I tried to write as much documentation as I could. But there is
certainly some missing doc here and there.
there are certainly other things that I have forgotten.
Improvements of that backend:
* the creation of an ecore_evas is faster. Especially when done over
an ssh connection (on my computer, 7-10s with Xlib, 1.5s with XCB,
over an ssh)
* A Window Manager should be more responsive. But it's not tomorrow
that e17 will use it :)
Have fun !
SVN revision: 29500
2007-04-13 10:15:19 -07:00
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
edata->configure_coming = 0;
|
2006-03-08 00:02:55 -08:00
|
|
|
if ((e->from_wm) || (ee->prop.override))
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
2010-09-29 10:03:38 -07:00
|
|
|
if ((ee->x != e->x) || (ee->y != e->y))
|
|
|
|
{
|
|
|
|
ee->x = e->x;
|
|
|
|
ee->y = e->y;
|
2010-02-27 06:40:10 -08:00
|
|
|
ee->req.x = ee->x;
|
|
|
|
ee->req.y = ee->y;
|
2010-09-29 10:03:38 -07:00
|
|
|
if (ee->func.fn_move) ee->func.fn_move(ee);
|
|
|
|
}
|
2003-09-23 01:09:32 -07:00
|
|
|
}
|
2013-12-29 20:39:18 -08:00
|
|
|
if ((ee->w != e->w) || (ee->h != e->h) ||
|
|
|
|
(ee->req.w != e->w) || (ee->req.h != e->h))
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
2010-09-29 10:03:38 -07:00
|
|
|
ee->w = e->w;
|
|
|
|
ee->h = e->h;
|
2010-02-27 06:40:10 -08:00
|
|
|
ee->req.w = ee->w;
|
|
|
|
ee->req.h = ee->h;
|
2014-01-18 05:26:10 -08:00
|
|
|
if (ECORE_EVAS_PORTRAIT(ee))
|
2010-09-29 10:03:38 -07:00
|
|
|
{
|
2014-01-18 05:26:10 -08:00
|
|
|
evas_output_size_set(ee->evas, ee->w, ee->h);
|
|
|
|
evas_output_viewport_set(ee->evas, 0, 0, ee->w, ee->h);
|
2010-09-29 10:03:38 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-01-18 05:26:10 -08:00
|
|
|
evas_output_size_set(ee->evas, ee->h, ee->w);
|
|
|
|
evas_output_viewport_set(ee->evas, 0, 0, ee->h, ee->w);
|
2010-09-29 10:03:38 -07:00
|
|
|
}
|
|
|
|
if (ee->prop.avoid_damage)
|
|
|
|
{
|
|
|
|
int pdam;
|
|
|
|
|
|
|
|
pdam = ecore_evas_avoid_damage_get(ee);
|
|
|
|
ecore_evas_avoid_damage_set(ee, 0);
|
|
|
|
ecore_evas_avoid_damage_set(ee, pdam);
|
|
|
|
}
|
|
|
|
if ((ee->shaped) || (ee->alpha))
|
|
|
|
_ecore_evas_x_resize_shape(ee);
|
2011-07-26 04:24:10 -07:00
|
|
|
if ((ee->expecting_resize.w > 0) && (ee->expecting_resize.h > 0))
|
2010-09-29 10:03:38 -07:00
|
|
|
{
|
|
|
|
if ((ee->expecting_resize.w == ee->w) &&
|
|
|
|
(ee->expecting_resize.h == ee->h))
|
|
|
|
_ecore_evas_mouse_move_process(ee, ee->mouse.x, ee->mouse.y,
|
|
|
|
ecore_x_current_time_get());
|
|
|
|
ee->expecting_resize.w = 0;
|
|
|
|
ee->expecting_resize.h = 0;
|
|
|
|
}
|
|
|
|
if (ee->func.fn_resize) ee->func.fn_resize(ee);
|
2014-02-08 16:46:51 -08:00
|
|
|
|
|
|
|
if (ee->prop.wm_rot.supported)
|
|
|
|
{
|
|
|
|
if (edata->wm_rot.prepare)
|
|
|
|
{
|
|
|
|
if ((ee->prop.wm_rot.w == e->w) &&
|
|
|
|
(ee->prop.wm_rot.h == e->h))
|
|
|
|
{
|
|
|
|
edata->wm_rot.configure_coming = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (edata->wm_rot.request)
|
|
|
|
{
|
|
|
|
if ((edata->wm_rot.configure_coming) &&
|
|
|
|
(ee->prop.wm_rot.w == e->w) &&
|
|
|
|
(ee->prop.wm_rot.h == e->h))
|
|
|
|
{
|
|
|
|
edata->wm_rot.configure_coming = 0;
|
|
|
|
if (ee->prop.wm_rot.manual_mode.set)
|
|
|
|
{
|
|
|
|
ee->prop.wm_rot.manual_mode.wait_for_done = EINA_TRUE;
|
|
|
|
_ecore_evas_x_wm_rot_manual_rotation_done_timeout_update(ee);
|
|
|
|
}
|
|
|
|
_ecore_evas_x_rotation_set(ee,
|
|
|
|
ee->prop.wm_rot.angle,
|
|
|
|
EINA_TRUE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2003-09-23 01:09:32 -07:00
|
|
|
}
|
2010-06-24 09:15:56 -07:00
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
2003-09-23 01:09:32 -07:00
|
|
|
}
|
|
|
|
|
2010-06-24 09:15:56 -07:00
|
|
|
static Eina_Bool
|
2012-11-25 01:55:32 -08:00
|
|
|
_ecore_evas_x_event_window_delete_request(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
|
|
|
Ecore_Evas *ee;
|
|
|
|
Ecore_X_Event_Window_Delete_Request *e;
|
Here is ecore_x with XCB backend.
* The XCB backend is disabled by default during the
configuration. To enable it, add --enable-ecore-x-xcb. See the
messages that configure displays when it finishes.
* The way XCB is detected, and used in src/lib/ecore_x/Makefile.am
should be improved
* Any program that uses ecore_evas does not need to be modified.
Any program that uses ecore_x may need some changes. That is,
adding some functions (_prefetch and _fetch ones). No other
change is needed. See the documention of any _get functions, as
these are the ones that need those functions.
* There are some missing parts, especially everything that involves
the keyboard, as porting Xlib functions related to strings (utf8
stuff, XKeysymToString, etc...) is an horror. So keyboard events
are not working yet.
* I tried to write as much documentation as I could. But there is
certainly some missing doc here and there.
there are certainly other things that I have forgotten.
Improvements of that backend:
* the creation of an ecore_evas is faster. Especially when done over
an ssh connection (on my computer, 7-10s with Xlib, 1.5s with XCB,
over an ssh)
* A Window Manager should be more responsive. But it's not tomorrow
that e17 will use it :)
Have fun !
SVN revision: 29500
2007-04-13 10:15:19 -07:00
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
e = event;
|
2009-03-19 06:06:16 -07:00
|
|
|
ee = ecore_event_window_match(e->win);
|
2010-06-24 09:15:56 -07:00
|
|
|
if (!ee) return ECORE_CALLBACK_PASS_ON; /* pass on event */
|
|
|
|
if (e->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
|
2003-09-23 01:09:32 -07:00
|
|
|
if (ee->func.fn_delete_request) ee->func.fn_delete_request(ee);
|
2010-06-24 09:15:56 -07:00
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
2003-09-23 01:09:32 -07:00
|
|
|
}
|
|
|
|
|
2010-06-24 09:15:56 -07:00
|
|
|
static Eina_Bool
|
2012-11-25 01:55:32 -08:00
|
|
|
_ecore_evas_x_event_window_show(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
|
|
|
Ecore_Evas *ee;
|
|
|
|
Ecore_X_Event_Window_Show *e;
|
2010-08-10 22:12:22 -07:00
|
|
|
static int first_map_bug = -1;
|
2011-04-20 07:15:33 -07:00
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
e = event;
|
2010-10-19 06:56:17 -07:00
|
|
|
ee = ecore_event_window_match(e->win);
|
2010-06-24 09:15:56 -07:00
|
|
|
if (!ee) return ECORE_CALLBACK_PASS_ON; /* pass on event */
|
|
|
|
if (e->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
|
2014-01-08 02:51:42 -08:00
|
|
|
|
2012-07-03 00:44:17 -07:00
|
|
|
if (ee->gl_sync_draw_done < 0)
|
|
|
|
{
|
2014-01-12 00:01:02 -08:00
|
|
|
char *sync = getenv("ECORE_EVAS_GL_SYNC_DRAW_DONE");
|
|
|
|
if (sync && (atoi(sync) == 1))
|
|
|
|
ee->gl_sync_draw_done = 1;
|
2012-07-03 00:44:17 -07:00
|
|
|
else
|
2014-01-08 02:51:42 -08:00
|
|
|
ee->gl_sync_draw_done = 0;
|
2012-07-03 00:44:17 -07:00
|
|
|
}
|
2014-01-08 02:51:42 -08:00
|
|
|
|
2010-08-10 22:12:22 -07:00
|
|
|
if (first_map_bug < 0)
|
|
|
|
{
|
2011-07-26 04:24:10 -07:00
|
|
|
char *bug = NULL;
|
|
|
|
|
|
|
|
if ((bug = getenv("ECORE_EVAS_GL_FIRST_MAP_BUG")))
|
|
|
|
first_map_bug = atoi(bug);
|
2010-08-10 22:12:22 -07:00
|
|
|
else
|
2011-07-26 04:24:10 -07:00
|
|
|
first_map_bug = 0;
|
2010-08-10 22:12:22 -07:00
|
|
|
}
|
2011-07-26 04:24:10 -07:00
|
|
|
if ((first_map_bug) && (!strcmp(ee->driver, "opengl_x11")))
|
|
|
|
evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
|
2014-10-29 03:33:16 -07:00
|
|
|
if (ee->prop.override)
|
|
|
|
{
|
|
|
|
ee->prop.withdrawn = EINA_FALSE;
|
|
|
|
if (ee->func.fn_state_change) ee->func.fn_state_change(ee);
|
|
|
|
}
|
2011-11-21 21:51:06 -08:00
|
|
|
if (ee->visible) return ECORE_CALLBACK_PASS_ON;
|
|
|
|
// if (ee->visible) return ECORE_CALLBACK_DONE;
|
2007-09-27 08:31:00 -07:00
|
|
|
// printf("SHOW EVENT %p\n", ee);
|
2003-09-23 01:09:32 -07:00
|
|
|
ee->visible = 1;
|
|
|
|
if (ee->func.fn_show) ee->func.fn_show(ee);
|
2010-06-24 09:15:56 -07:00
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
2003-09-23 01:09:32 -07:00
|
|
|
}
|
|
|
|
|
2010-06-24 09:15:56 -07:00
|
|
|
static Eina_Bool
|
2012-11-25 01:55:32 -08:00
|
|
|
_ecore_evas_x_event_window_hide(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
|
|
|
Ecore_Evas *ee;
|
|
|
|
Ecore_X_Event_Window_Hide *e;
|
Here is ecore_x with XCB backend.
* The XCB backend is disabled by default during the
configuration. To enable it, add --enable-ecore-x-xcb. See the
messages that configure displays when it finishes.
* The way XCB is detected, and used in src/lib/ecore_x/Makefile.am
should be improved
* Any program that uses ecore_evas does not need to be modified.
Any program that uses ecore_x may need some changes. That is,
adding some functions (_prefetch and _fetch ones). No other
change is needed. See the documention of any _get functions, as
these are the ones that need those functions.
* There are some missing parts, especially everything that involves
the keyboard, as porting Xlib functions related to strings (utf8
stuff, XKeysymToString, etc...) is an horror. So keyboard events
are not working yet.
* I tried to write as much documentation as I could. But there is
certainly some missing doc here and there.
there are certainly other things that I have forgotten.
Improvements of that backend:
* the creation of an ecore_evas is faster. Especially when done over
an ssh connection (on my computer, 7-10s with Xlib, 1.5s with XCB,
over an ssh)
* A Window Manager should be more responsive. But it's not tomorrow
that e17 will use it :)
Have fun !
SVN revision: 29500
2007-04-13 10:15:19 -07:00
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
e = event;
|
2010-10-19 06:56:17 -07:00
|
|
|
ee = ecore_event_window_match(e->win);
|
2010-06-24 09:15:56 -07:00
|
|
|
if (!ee) return ECORE_CALLBACK_PASS_ON; /* pass on event */
|
|
|
|
if (e->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
|
2011-12-27 04:02:18 -08:00
|
|
|
if (ee->in)
|
|
|
|
{
|
|
|
|
evas_event_feed_mouse_cancel(ee->evas, e->time, NULL);
|
|
|
|
evas_event_feed_mouse_out(ee->evas, e->time, NULL);
|
|
|
|
if (ee->func.fn_mouse_out) ee->func.fn_mouse_out(ee);
|
|
|
|
if (ee->prop.cursor.object) evas_object_hide(ee->prop.cursor.object);
|
|
|
|
ee->in = EINA_FALSE;
|
|
|
|
}
|
2014-10-29 03:33:16 -07:00
|
|
|
if (ee->prop.override)
|
|
|
|
{
|
|
|
|
ee->prop.withdrawn = EINA_TRUE;
|
|
|
|
if (ee->func.fn_state_change) ee->func.fn_state_change(ee);
|
|
|
|
}
|
2011-11-21 21:51:06 -08:00
|
|
|
if (!ee->visible) return ECORE_CALLBACK_PASS_ON;
|
|
|
|
// if (!ee->visible) return ECORE_CALLBACK_DONE;
|
2007-09-27 08:43:08 -07:00
|
|
|
// printf("HIDE EVENT %p\n", ee);
|
2003-09-23 01:09:32 -07:00
|
|
|
ee->visible = 0;
|
|
|
|
if (ee->func.fn_hide) ee->func.fn_hide(ee);
|
2010-06-24 09:15:56 -07:00
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
2003-09-23 01:09:32 -07:00
|
|
|
}
|
|
|
|
|
2005-06-09 21:18:24 -07:00
|
|
|
/* FIXME, should be in idler */
|
Here is ecore_x with XCB backend.
* The XCB backend is disabled by default during the
configuration. To enable it, add --enable-ecore-x-xcb. See the
messages that configure displays when it finishes.
* The way XCB is detected, and used in src/lib/ecore_x/Makefile.am
should be improved
* Any program that uses ecore_evas does not need to be modified.
Any program that uses ecore_x may need some changes. That is,
adding some functions (_prefetch and _fetch ones). No other
change is needed. See the documention of any _get functions, as
these are the ones that need those functions.
* There are some missing parts, especially everything that involves
the keyboard, as porting Xlib functions related to strings (utf8
stuff, XKeysymToString, etc...) is an horror. So keyboard events
are not working yet.
* I tried to write as much documentation as I could. But there is
certainly some missing doc here and there.
there are certainly other things that I have forgotten.
Improvements of that backend:
* the creation of an ecore_evas is faster. Especially when done over
an ssh connection (on my computer, 7-10s with Xlib, 1.5s with XCB,
over an ssh)
* A Window Manager should be more responsive. But it's not tomorrow
that e17 will use it :)
Have fun !
SVN revision: 29500
2007-04-13 10:15:19 -07:00
|
|
|
/* FIXME, round trip */
|
2005-06-09 21:18:24 -07:00
|
|
|
static void
|
2005-06-10 23:05:51 -07:00
|
|
|
_ecore_evas_x_size_pos_hints_update(Ecore_Evas *ee)
|
2005-06-09 21:18:24 -07:00
|
|
|
{
|
2009-03-16 09:24:43 -07:00
|
|
|
ecore_x_icccm_size_pos_hints_set(ee->prop.window,
|
2010-09-29 10:03:38 -07:00
|
|
|
ee->prop.request_pos /*request_pos */,
|
|
|
|
ECORE_X_GRAVITY_NW /* gravity */,
|
|
|
|
ee->prop.min.w /* min_w */,
|
|
|
|
ee->prop.min.h /* min_h */,
|
|
|
|
ee->prop.max.w /* max_w */,
|
|
|
|
ee->prop.max.h /* max_h */,
|
|
|
|
ee->prop.base.w /* base_w */,
|
|
|
|
ee->prop.base.h /* base_h */,
|
|
|
|
ee->prop.step.w /* step_x */,
|
|
|
|
ee->prop.step.h /* step_y */,
|
2012-02-27 22:43:59 -08:00
|
|
|
ee->prop.aspect /* min_aspect */,
|
|
|
|
ee->prop.aspect /* max_aspect */);
|
2005-06-09 21:18:24 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/* FIXME, should be in idler */
|
|
|
|
static void
|
2005-06-10 23:05:51 -07:00
|
|
|
_ecore_evas_x_state_update(Ecore_Evas *ee)
|
2005-06-09 21:18:24 -07:00
|
|
|
{
|
|
|
|
Ecore_X_Window_State state[10];
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
|
2011-07-26 04:24:10 -07:00
|
|
|
int num = 0;
|
2005-06-09 21:18:24 -07:00
|
|
|
|
2012-02-27 22:43:59 -08:00
|
|
|
if (ee->prop.modal)
|
2005-06-09 21:18:24 -07:00
|
|
|
state[num++] = ECORE_X_WINDOW_STATE_MODAL;
|
2012-02-27 22:43:59 -08:00
|
|
|
if (ee->prop.sticky)
|
2005-06-09 21:18:24 -07:00
|
|
|
state[num++] = ECORE_X_WINDOW_STATE_STICKY;
|
2012-02-27 22:43:59 -08:00
|
|
|
if (ee->prop.maximized)
|
2005-06-09 21:18:24 -07:00
|
|
|
state[num++] = ECORE_X_WINDOW_STATE_MAXIMIZED_VERT;
|
2012-02-27 22:43:59 -08:00
|
|
|
if (ee->prop.maximized)
|
2005-06-09 21:18:24 -07:00
|
|
|
state[num++] = ECORE_X_WINDOW_STATE_MAXIMIZED_HORZ;
|
2012-02-27 22:43:59 -08:00
|
|
|
// if (bd->client.netwm.state.shaded)
|
|
|
|
// state[num++] = ECORE_X_WINDOW_STATE_SHADED;
|
|
|
|
if (ee->prop.focus_skip)
|
2005-06-09 21:18:24 -07:00
|
|
|
state[num++] = ECORE_X_WINDOW_STATE_SKIP_TASKBAR;
|
2012-02-27 22:43:59 -08:00
|
|
|
if (ee->prop.focus_skip)
|
2005-06-09 21:18:24 -07:00
|
|
|
state[num++] = ECORE_X_WINDOW_STATE_SKIP_PAGER;
|
2012-02-27 22:43:59 -08:00
|
|
|
// if (bd->client.netwm.state.hidden)
|
|
|
|
// state[num++] = ECORE_X_WINDOW_STATE_HIDDEN;
|
2012-12-05 13:15:42 -08:00
|
|
|
if (edata->state.fullscreen)
|
2006-08-12 03:16:53 -07:00
|
|
|
state[num++] = ECORE_X_WINDOW_STATE_FULLSCREEN;
|
2012-12-05 13:15:42 -08:00
|
|
|
if (edata->state.above)
|
2005-06-09 21:18:24 -07:00
|
|
|
state[num++] = ECORE_X_WINDOW_STATE_ABOVE;
|
2012-12-05 13:15:42 -08:00
|
|
|
if (edata->state.below)
|
2005-06-09 21:18:24 -07:00
|
|
|
state[num++] = ECORE_X_WINDOW_STATE_BELOW;
|
2012-02-27 22:43:59 -08:00
|
|
|
if (ee->prop.demand_attention)
|
|
|
|
state[num++] = ECORE_X_WINDOW_STATE_DEMANDS_ATTENTION;
|
2005-06-09 21:18:24 -07:00
|
|
|
|
2009-03-16 09:24:43 -07:00
|
|
|
ecore_x_netwm_window_state_set(ee->prop.window, state, num);
|
2005-06-09 21:18:24 -07:00
|
|
|
}
|
|
|
|
|
2005-09-05 01:40:50 -07:00
|
|
|
static void
|
2005-06-10 23:05:51 -07:00
|
|
|
_ecore_evas_x_layer_update(Ecore_Evas *ee)
|
2005-06-09 21:18:24 -07:00
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
|
|
|
|
|
2005-06-09 21:18:24 -07:00
|
|
|
if (ee->should_be_visible)
|
|
|
|
{
|
2010-09-29 10:03:38 -07:00
|
|
|
/* We need to send a netwm request to the wm */
|
|
|
|
/* FIXME: Do we have to remove old state before adding new? */
|
|
|
|
if (ee->prop.layer < 3)
|
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
if (edata->state.above)
|
2010-09-29 10:03:38 -07:00
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
edata->state.above = 0;
|
2010-09-29 10:03:38 -07:00
|
|
|
ecore_x_netwm_state_request_send(ee->prop.window,
|
2012-12-05 13:15:42 -08:00
|
|
|
edata->win_root,
|
2010-09-29 10:03:38 -07:00
|
|
|
ECORE_X_WINDOW_STATE_ABOVE, -1, 0);
|
|
|
|
}
|
2012-12-05 13:15:42 -08:00
|
|
|
if (!edata->state.below)
|
2010-09-29 10:03:38 -07:00
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
edata->state.below = 1;
|
2010-09-29 10:03:38 -07:00
|
|
|
ecore_x_netwm_state_request_send(ee->prop.window,
|
2012-12-05 13:15:42 -08:00
|
|
|
edata->win_root,
|
2010-09-29 10:03:38 -07:00
|
|
|
ECORE_X_WINDOW_STATE_BELOW, -1, 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (ee->prop.layer > 5)
|
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
if (edata->state.below)
|
2010-09-29 10:03:38 -07:00
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
edata->state.below = 0;
|
2010-09-29 10:03:38 -07:00
|
|
|
ecore_x_netwm_state_request_send(ee->prop.window,
|
2012-12-05 13:15:42 -08:00
|
|
|
edata->win_root,
|
2010-09-29 10:03:38 -07:00
|
|
|
ECORE_X_WINDOW_STATE_BELOW, -1, 0);
|
|
|
|
}
|
2012-12-05 13:15:42 -08:00
|
|
|
if (!edata->state.above)
|
2010-09-29 10:03:38 -07:00
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
edata->state.above = 1;
|
2010-09-29 10:03:38 -07:00
|
|
|
ecore_x_netwm_state_request_send(ee->prop.window,
|
2012-12-05 13:15:42 -08:00
|
|
|
edata->win_root,
|
2010-09-29 10:03:38 -07:00
|
|
|
ECORE_X_WINDOW_STATE_ABOVE, -1, 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
if (edata->state.below)
|
2010-09-29 10:03:38 -07:00
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
edata->state.below = 0;
|
2010-09-29 10:03:38 -07:00
|
|
|
ecore_x_netwm_state_request_send(ee->prop.window,
|
2012-12-05 13:15:42 -08:00
|
|
|
edata->win_root,
|
2010-09-29 10:03:38 -07:00
|
|
|
ECORE_X_WINDOW_STATE_BELOW, -1, 0);
|
|
|
|
}
|
2012-12-05 13:15:42 -08:00
|
|
|
if (edata->state.above)
|
2010-09-29 10:03:38 -07:00
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
edata->state.above = 0;
|
2010-09-29 10:03:38 -07:00
|
|
|
ecore_x_netwm_state_request_send(ee->prop.window,
|
2012-12-05 13:15:42 -08:00
|
|
|
edata->win_root,
|
2010-09-29 10:03:38 -07:00
|
|
|
ECORE_X_WINDOW_STATE_ABOVE, -1, 0);
|
|
|
|
}
|
|
|
|
}
|
2005-06-09 21:18:24 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-09-29 10:03:38 -07:00
|
|
|
/* Just set the state */
|
|
|
|
if (ee->prop.layer < 3)
|
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
if ((edata->state.above) || (!edata->state.below))
|
2010-09-29 10:03:38 -07:00
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
edata->state.above = 0;
|
|
|
|
edata->state.below = 1;
|
2010-09-29 10:03:38 -07:00
|
|
|
_ecore_evas_x_state_update(ee);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (ee->prop.layer > 5)
|
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
if ((!edata->state.above) || (edata->state.below))
|
2010-09-29 10:03:38 -07:00
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
edata->state.above = 1;
|
|
|
|
edata->state.below = 0;
|
2010-09-29 10:03:38 -07:00
|
|
|
_ecore_evas_x_state_update(ee);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
if ((edata->state.above) || (edata->state.below))
|
2010-09-29 10:03:38 -07:00
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
edata->state.above = 0;
|
|
|
|
edata->state.below = 0;
|
2010-09-29 10:03:38 -07:00
|
|
|
_ecore_evas_x_state_update(ee);
|
|
|
|
}
|
|
|
|
}
|
2005-06-09 21:18:24 -07:00
|
|
|
}
|
|
|
|
/* FIXME: Set gnome layer */
|
|
|
|
}
|
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
static int
|
|
|
|
_ecore_evas_x_init(void)
|
|
|
|
{
|
|
|
|
_ecore_evas_init_count++;
|
|
|
|
if (_ecore_evas_init_count > 1) return _ecore_evas_init_count;
|
2011-09-21 23:02:26 -07:00
|
|
|
ecore_evas_event_handlers[0] =
|
|
|
|
ecore_event_handler_add(ECORE_X_EVENT_MOUSE_IN,
|
2011-07-26 04:24:10 -07:00
|
|
|
_ecore_evas_x_event_mouse_in, NULL);
|
2011-09-21 23:02:26 -07:00
|
|
|
ecore_evas_event_handlers[1] =
|
|
|
|
ecore_event_handler_add(ECORE_X_EVENT_MOUSE_OUT,
|
2011-07-26 04:24:10 -07:00
|
|
|
_ecore_evas_x_event_mouse_out, NULL);
|
2011-09-21 23:02:26 -07:00
|
|
|
ecore_evas_event_handlers[2] =
|
|
|
|
ecore_event_handler_add(ECORE_X_EVENT_WINDOW_FOCUS_IN,
|
2011-07-26 04:24:10 -07:00
|
|
|
_ecore_evas_x_event_window_focus_in, NULL);
|
2011-09-21 23:02:26 -07:00
|
|
|
ecore_evas_event_handlers[3] =
|
|
|
|
ecore_event_handler_add(ECORE_X_EVENT_WINDOW_FOCUS_OUT,
|
2011-07-26 04:24:10 -07:00
|
|
|
_ecore_evas_x_event_window_focus_out, NULL);
|
2011-09-21 23:02:26 -07:00
|
|
|
ecore_evas_event_handlers[4] =
|
|
|
|
ecore_event_handler_add(ECORE_X_EVENT_WINDOW_DAMAGE,
|
2011-07-26 04:24:10 -07:00
|
|
|
_ecore_evas_x_event_window_damage, NULL);
|
2011-09-21 23:02:26 -07:00
|
|
|
ecore_evas_event_handlers[5] =
|
|
|
|
ecore_event_handler_add(ECORE_X_EVENT_WINDOW_DESTROY,
|
2011-07-26 04:24:10 -07:00
|
|
|
_ecore_evas_x_event_window_destroy, NULL);
|
2011-09-21 23:02:26 -07:00
|
|
|
ecore_evas_event_handlers[6] =
|
|
|
|
ecore_event_handler_add(ECORE_X_EVENT_WINDOW_CONFIGURE,
|
2011-07-26 04:24:10 -07:00
|
|
|
_ecore_evas_x_event_window_configure, NULL);
|
2011-09-21 23:02:26 -07:00
|
|
|
ecore_evas_event_handlers[7] =
|
|
|
|
ecore_event_handler_add(ECORE_X_EVENT_WINDOW_DELETE_REQUEST,
|
2011-07-26 04:24:10 -07:00
|
|
|
_ecore_evas_x_event_window_delete_request, NULL);
|
2011-09-21 23:02:26 -07:00
|
|
|
ecore_evas_event_handlers[8] =
|
|
|
|
ecore_event_handler_add(ECORE_X_EVENT_WINDOW_SHOW,
|
2011-07-26 04:24:10 -07:00
|
|
|
_ecore_evas_x_event_window_show, NULL);
|
2011-09-21 23:02:26 -07:00
|
|
|
ecore_evas_event_handlers[9] =
|
|
|
|
ecore_event_handler_add(ECORE_X_EVENT_WINDOW_HIDE,
|
2011-07-26 04:24:10 -07:00
|
|
|
_ecore_evas_x_event_window_hide, NULL);
|
2011-09-21 23:02:26 -07:00
|
|
|
ecore_evas_event_handlers[10] =
|
|
|
|
ecore_event_handler_add(ECORE_X_EVENT_WINDOW_PROPERTY,
|
2011-07-26 04:24:10 -07:00
|
|
|
_ecore_evas_x_event_property_change, NULL);
|
2011-09-21 23:02:26 -07:00
|
|
|
ecore_evas_event_handlers[11] =
|
|
|
|
ecore_event_handler_add(ECORE_X_EVENT_WINDOW_VISIBILITY_CHANGE,
|
2011-07-26 04:24:10 -07:00
|
|
|
_ecore_evas_x_event_visibility_change, NULL);
|
2011-09-21 23:02:26 -07:00
|
|
|
ecore_evas_event_handlers[12] =
|
|
|
|
ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE,
|
2011-07-26 04:24:10 -07:00
|
|
|
_ecore_evas_x_event_client_message, NULL);
|
2009-03-19 06:06:16 -07:00
|
|
|
ecore_event_evas_init();
|
2003-09-23 01:09:32 -07:00
|
|
|
return _ecore_evas_init_count;
|
|
|
|
}
|
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
int
|
|
|
|
_ecore_evas_x_shutdown(void)
|
|
|
|
{
|
|
|
|
_ecore_evas_init_count--;
|
|
|
|
if (_ecore_evas_init_count == 0)
|
|
|
|
{
|
|
|
|
unsigned int i;
|
|
|
|
|
|
|
|
for (i = 0; i < sizeof(ecore_evas_event_handlers) / sizeof(Ecore_Event_Handler*); i++)
|
|
|
|
{
|
|
|
|
if (ecore_evas_event_handlers[i])
|
|
|
|
ecore_event_handler_del(ecore_evas_event_handlers[i]);
|
|
|
|
}
|
|
|
|
ecore_event_evas_shutdown();
|
|
|
|
}
|
|
|
|
if (_ecore_evas_init_count < 0) _ecore_evas_init_count = 0;
|
|
|
|
return _ecore_evas_init_count;
|
|
|
|
}
|
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
static void
|
|
|
|
_ecore_evas_x_free(Ecore_Evas *ee)
|
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
|
|
|
|
|
2013-07-05 02:38:43 -07:00
|
|
|
if (edata->pixmap.back)
|
|
|
|
ecore_x_pixmap_free(edata->pixmap.back);
|
|
|
|
if (edata->pixmap.front)
|
|
|
|
ecore_x_pixmap_free(edata->pixmap.front);
|
2014-02-08 16:46:51 -08:00
|
|
|
if (edata->wm_rot.manual_mode_job)
|
|
|
|
{
|
|
|
|
ecore_job_del(edata->wm_rot.manual_mode_job);
|
|
|
|
edata->wm_rot.manual_mode_job = NULL;
|
|
|
|
}
|
2013-07-05 02:38:43 -07:00
|
|
|
|
2010-10-01 18:56:23 -07:00
|
|
|
_ecore_evas_x_group_leader_unset(ee);
|
2013-08-01 04:17:58 -07:00
|
|
|
if (edata->sync_counter)
|
|
|
|
ecore_x_sync_counter_free(edata->sync_counter);
|
2015-01-08 05:35:49 -08:00
|
|
|
if (edata->netwm_sync_counter)
|
|
|
|
ecore_x_sync_counter_free(edata->netwm_sync_counter);
|
2012-12-05 13:15:42 -08:00
|
|
|
if (edata->win_shaped_input)
|
|
|
|
ecore_x_window_free(edata->win_shaped_input);
|
2013-07-24 05:58:57 -07:00
|
|
|
ecore_event_window_unregister(ee->prop.window);
|
|
|
|
if (ee->prop.window && (!edata->destroyed)) ecore_x_window_free(ee->prop.window);
|
2012-12-05 13:15:42 -08:00
|
|
|
if (edata->pmap) ecore_x_pixmap_free(edata->pmap);
|
|
|
|
if (edata->mask) ecore_x_pixmap_free(edata->mask);
|
|
|
|
if (edata->gc) ecore_x_gc_free(edata->gc);
|
|
|
|
if (edata->damages) ecore_x_xregion_free(edata->damages);
|
|
|
|
edata->pmap = 0;
|
|
|
|
edata->mask = 0;
|
|
|
|
edata->gc = 0;
|
|
|
|
edata->damages = NULL;
|
|
|
|
while (edata->win_extra)
|
2005-09-24 02:00:23 -07:00
|
|
|
{
|
2010-09-29 10:03:38 -07:00
|
|
|
Ecore_X_Window *winp;
|
Here is ecore_x with XCB backend.
* The XCB backend is disabled by default during the
configuration. To enable it, add --enable-ecore-x-xcb. See the
messages that configure displays when it finishes.
* The way XCB is detected, and used in src/lib/ecore_x/Makefile.am
should be improved
* Any program that uses ecore_evas does not need to be modified.
Any program that uses ecore_x may need some changes. That is,
adding some functions (_prefetch and _fetch ones). No other
change is needed. See the documention of any _get functions, as
these are the ones that need those functions.
* There are some missing parts, especially everything that involves
the keyboard, as porting Xlib functions related to strings (utf8
stuff, XKeysymToString, etc...) is an horror. So keyboard events
are not working yet.
* I tried to write as much documentation as I could. But there is
certainly some missing doc here and there.
there are certainly other things that I have forgotten.
Improvements of that backend:
* the creation of an ecore_evas is faster. Especially when done over
an ssh connection (on my computer, 7-10s with Xlib, 1.5s with XCB,
over an ssh)
* A Window Manager should be more responsive. But it's not tomorrow
that e17 will use it :)
Have fun !
SVN revision: 29500
2007-04-13 10:15:19 -07:00
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
winp = edata->win_extra->data;
|
|
|
|
edata->win_extra =
|
|
|
|
eina_list_remove_list(edata->win_extra, edata->win_extra);
|
2010-09-29 10:03:38 -07:00
|
|
|
ecore_event_window_unregister(*winp);
|
|
|
|
free(winp);
|
2005-09-24 02:00:23 -07:00
|
|
|
}
|
2013-10-18 03:23:38 -07:00
|
|
|
if (edata->outdelay)
|
|
|
|
{
|
|
|
|
ecore_timer_del(edata->outdelay);
|
|
|
|
edata->outdelay = NULL;
|
|
|
|
}
|
2012-12-05 13:15:42 -08:00
|
|
|
free(edata);
|
2003-09-23 01:09:32 -07:00
|
|
|
_ecore_evas_x_shutdown();
|
|
|
|
ecore_x_shutdown();
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-02-19 20:38:54 -08:00
|
|
|
_ecore_evas_x_callback_delete_request_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
|
|
|
ee->func.fn_delete_request = func;
|
2010-01-29 02:28:54 -08:00
|
|
|
_ecore_evas_x_protocols_set(ee);
|
2010-01-30 02:42:22 -08:00
|
|
|
_ecore_evas_x_sync_set(ee);
|
2003-09-23 01:09:32 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-06-10 23:05:51 -07:00
|
|
|
_ecore_evas_x_move(Ecore_Evas *ee, int x, int y)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
|
|
|
|
|
2010-02-27 06:40:10 -08:00
|
|
|
ee->req.x = x;
|
|
|
|
ee->req.y = y;
|
2012-12-05 13:15:42 -08:00
|
|
|
if (edata->direct_resize)
|
2005-06-13 04:57:14 -07:00
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
if (!edata->managed)
|
2010-09-29 10:03:38 -07:00
|
|
|
{
|
|
|
|
if ((x != ee->x) || (y != ee->y))
|
|
|
|
{
|
|
|
|
ee->x = x;
|
|
|
|
ee->y = y;
|
|
|
|
ecore_x_window_move(ee->prop.window, x, y);
|
|
|
|
if (!ee->should_be_visible)
|
|
|
|
{
|
|
|
|
/* We need to request pos */
|
2014-01-12 21:26:36 -08:00
|
|
|
ee->prop.request_pos = EINA_TRUE;
|
2010-09-29 10:03:38 -07:00
|
|
|
_ecore_evas_x_size_pos_hints_update(ee);
|
|
|
|
}
|
|
|
|
if (ee->func.fn_move) ee->func.fn_move(ee);
|
|
|
|
}
|
|
|
|
}
|
2005-06-13 04:57:14 -07:00
|
|
|
}
|
2005-11-03 03:32:59 -08:00
|
|
|
else
|
|
|
|
{
|
2011-10-25 22:29:38 -07:00
|
|
|
if (((ee->x != x) || (ee->y != y)) ||
|
2012-12-05 13:15:42 -08:00
|
|
|
(edata->configure_coming))
|
2011-09-21 13:55:12 -07:00
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
edata->configure_coming = 1;
|
|
|
|
if (!edata->managed)
|
2011-09-21 13:55:12 -07:00
|
|
|
{
|
|
|
|
ee->x = x;
|
|
|
|
ee->y = y;
|
|
|
|
}
|
|
|
|
ecore_x_window_move(ee->prop.window, x, y);
|
|
|
|
}
|
2010-09-29 10:03:38 -07:00
|
|
|
if (!ee->should_be_visible)
|
|
|
|
{
|
|
|
|
/* We need to request pos */
|
2014-01-12 21:26:36 -08:00
|
|
|
ee->prop.request_pos = EINA_TRUE;
|
2010-09-29 10:03:38 -07:00
|
|
|
_ecore_evas_x_size_pos_hints_update(ee);
|
|
|
|
}
|
2005-11-03 03:32:59 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_ecore_evas_x_managed_move(Ecore_Evas *ee, int x, int y)
|
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
|
|
|
|
|
2010-02-27 06:40:10 -08:00
|
|
|
ee->req.x = x;
|
|
|
|
ee->req.y = y;
|
2012-12-05 13:15:42 -08:00
|
|
|
if (edata->direct_resize)
|
2005-11-02 22:16:40 -08:00
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
edata->managed = 1;
|
2010-09-29 10:03:38 -07:00
|
|
|
if ((x != ee->x) || (y != ee->y))
|
|
|
|
{
|
|
|
|
ee->x = x;
|
|
|
|
ee->y = y;
|
|
|
|
if (ee->func.fn_move) ee->func.fn_move(ee);
|
|
|
|
}
|
2005-11-02 22:16:40 -08:00
|
|
|
}
|
2003-09-23 01:09:32 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-06-10 23:05:51 -07:00
|
|
|
_ecore_evas_x_resize(Ecore_Evas *ee, int w, int h)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
|
|
|
|
|
2010-02-27 06:40:10 -08:00
|
|
|
ee->req.w = w;
|
|
|
|
ee->req.h = h;
|
2013-07-05 02:38:43 -07:00
|
|
|
|
|
|
|
/* check for valid property window
|
|
|
|
*
|
|
|
|
* NB: If we do not have one, check for valid pixmap rendering */
|
|
|
|
if (!ee->prop.window)
|
|
|
|
{
|
|
|
|
/* the ecore_evas was resized. we need to free the back pixmap */
|
|
|
|
if ((edata->pixmap.w != w) || (edata->pixmap.h != h))
|
|
|
|
{
|
|
|
|
/* free the backing pixmap */
|
|
|
|
if (edata->pixmap.back)
|
|
|
|
ecore_x_pixmap_free(edata->pixmap.back);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
if (edata->direct_resize)
|
2004-11-23 07:17:56 -08:00
|
|
|
{
|
2010-09-29 10:03:38 -07:00
|
|
|
if ((ee->w != w) || (ee->h != h))
|
|
|
|
{
|
|
|
|
ee->w = w;
|
|
|
|
ee->h = h;
|
2013-07-05 02:38:43 -07:00
|
|
|
if (ee->prop.window) ecore_x_window_resize(ee->prop.window, w, h);
|
2014-01-18 05:26:10 -08:00
|
|
|
if (ECORE_EVAS_PORTRAIT(ee))
|
2010-09-29 10:03:38 -07:00
|
|
|
{
|
2014-01-18 05:26:10 -08:00
|
|
|
evas_output_size_set(ee->evas, ee->w, ee->h);
|
|
|
|
evas_output_viewport_set(ee->evas, 0, 0, ee->w, ee->h);
|
2010-09-29 10:03:38 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-01-18 05:26:10 -08:00
|
|
|
evas_output_size_set(ee->evas, ee->h, ee->w);
|
|
|
|
evas_output_viewport_set(ee->evas, 0, 0, ee->h, ee->w);
|
2010-09-29 10:03:38 -07:00
|
|
|
}
|
|
|
|
if (ee->prop.avoid_damage)
|
|
|
|
{
|
|
|
|
int pdam;
|
|
|
|
|
|
|
|
pdam = ecore_evas_avoid_damage_get(ee);
|
|
|
|
ecore_evas_avoid_damage_set(ee, 0);
|
|
|
|
ecore_evas_avoid_damage_set(ee, pdam);
|
|
|
|
}
|
|
|
|
if ((ee->shaped) || (ee->alpha))
|
|
|
|
_ecore_evas_x_resize_shape(ee);
|
|
|
|
if (ee->func.fn_resize) ee->func.fn_resize(ee);
|
|
|
|
}
|
2004-11-23 07:17:56 -08:00
|
|
|
}
|
2011-10-25 22:29:38 -07:00
|
|
|
else if (((ee->w != w) || (ee->h != h)) ||
|
2012-12-05 13:15:42 -08:00
|
|
|
(edata->configure_coming))
|
2011-10-25 22:29:38 -07:00
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
edata->configure_coming = 1;
|
2013-07-05 02:38:43 -07:00
|
|
|
if (ee->prop.window) ecore_x_window_resize(ee->prop.window, w, h);
|
2011-10-25 22:29:38 -07:00
|
|
|
}
|
2003-09-23 01:09:32 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-06-10 23:05:51 -07:00
|
|
|
_ecore_evas_x_move_resize(Ecore_Evas *ee, int x, int y, int w, int h)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
|
|
|
|
|
2010-02-27 06:40:10 -08:00
|
|
|
ee->req.x = x;
|
|
|
|
ee->req.y = y;
|
|
|
|
ee->req.w = w;
|
|
|
|
ee->req.h = h;
|
2012-12-05 13:15:42 -08:00
|
|
|
if (edata->direct_resize)
|
2004-11-23 07:17:56 -08:00
|
|
|
{
|
2010-09-29 10:03:38 -07:00
|
|
|
if ((ee->w != w) || (ee->h != h) || (x != ee->x) || (y != ee->y))
|
|
|
|
{
|
|
|
|
int change_size = 0, change_pos = 0;
|
|
|
|
|
|
|
|
if ((ee->w != w) || (ee->h != h)) change_size = 1;
|
2012-12-05 13:15:42 -08:00
|
|
|
if (!edata->managed)
|
2010-09-29 10:03:38 -07:00
|
|
|
{
|
|
|
|
if ((x != ee->x) || (y != ee->y)) change_pos = 1;
|
|
|
|
}
|
|
|
|
ecore_x_window_move_resize(ee->prop.window, x, y, w, h);
|
2012-12-05 13:15:42 -08:00
|
|
|
if (!edata->managed)
|
2010-09-29 10:03:38 -07:00
|
|
|
{
|
|
|
|
ee->x = x;
|
|
|
|
ee->y = y;
|
|
|
|
}
|
|
|
|
ee->w = w;
|
|
|
|
ee->h = h;
|
2014-01-18 05:26:10 -08:00
|
|
|
if (ECORE_EVAS_PORTRAIT(ee))
|
2010-09-29 10:03:38 -07:00
|
|
|
{
|
2014-01-18 05:26:10 -08:00
|
|
|
evas_output_size_set(ee->evas, ee->w, ee->h);
|
|
|
|
evas_output_viewport_set(ee->evas, 0, 0, ee->w, ee->h);
|
2010-09-29 10:03:38 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-01-18 05:26:10 -08:00
|
|
|
evas_output_size_set(ee->evas, ee->h, ee->w);
|
|
|
|
evas_output_viewport_set(ee->evas, 0, 0, ee->h, ee->w);
|
2010-09-29 10:03:38 -07:00
|
|
|
}
|
|
|
|
if (ee->prop.avoid_damage)
|
|
|
|
{
|
|
|
|
int pdam;
|
|
|
|
|
|
|
|
pdam = ecore_evas_avoid_damage_get(ee);
|
|
|
|
ecore_evas_avoid_damage_set(ee, 0);
|
|
|
|
ecore_evas_avoid_damage_set(ee, pdam);
|
|
|
|
}
|
|
|
|
if ((ee->shaped) || (ee->alpha))
|
|
|
|
_ecore_evas_x_resize_shape(ee);
|
|
|
|
if (change_pos)
|
|
|
|
{
|
|
|
|
if (ee->func.fn_move) ee->func.fn_move(ee);
|
|
|
|
}
|
|
|
|
if (change_size)
|
|
|
|
{
|
|
|
|
if (ee->func.fn_resize) ee->func.fn_resize(ee);
|
|
|
|
}
|
|
|
|
}
|
2004-11-23 07:17:56 -08:00
|
|
|
}
|
2011-10-25 22:29:38 -07:00
|
|
|
else if (((ee->w != w) || (ee->h != h) || (ee->x != x) || (ee->y != y)) ||
|
2012-12-05 13:15:42 -08:00
|
|
|
(edata->configure_coming))
|
2006-07-20 10:12:30 -07:00
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
edata->configure_coming = 1;
|
2010-09-29 10:03:38 -07:00
|
|
|
ecore_x_window_move_resize(ee->prop.window, x, y, w, h);
|
2012-12-05 13:15:42 -08:00
|
|
|
if (!edata->managed)
|
2010-09-29 10:03:38 -07:00
|
|
|
{
|
|
|
|
ee->x = x;
|
|
|
|
ee->y = y;
|
|
|
|
}
|
2006-07-20 10:12:30 -07:00
|
|
|
}
|
2003-09-23 01:09:32 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-02-10 06:35:07 -08:00
|
|
|
_ecore_evas_x_rotation_set_internal(Ecore_Evas *ee, int rotation, int resize,
|
2010-09-29 10:03:38 -07:00
|
|
|
Evas_Engine_Info *einfo)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
|
|
|
int rot_dif;
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
|
Here is ecore_x with XCB backend.
* The XCB backend is disabled by default during the
configuration. To enable it, add --enable-ecore-x-xcb. See the
messages that configure displays when it finishes.
* The way XCB is detected, and used in src/lib/ecore_x/Makefile.am
should be improved
* Any program that uses ecore_evas does not need to be modified.
Any program that uses ecore_x may need some changes. That is,
adding some functions (_prefetch and _fetch ones). No other
change is needed. See the documention of any _get functions, as
these are the ones that need those functions.
* There are some missing parts, especially everything that involves
the keyboard, as porting Xlib functions related to strings (utf8
stuff, XKeysymToString, etc...) is an horror. So keyboard events
are not working yet.
* I tried to write as much documentation as I could. But there is
certainly some missing doc here and there.
there are certainly other things that I have forgotten.
Improvements of that backend:
* the creation of an ecore_evas is faster. Especially when done over
an ssh connection (on my computer, 7-10s with Xlib, 1.5s with XCB,
over an ssh)
* A Window Manager should be more responsive. But it's not tomorrow
that e17 will use it :)
Have fun !
SVN revision: 29500
2007-04-13 10:15:19 -07:00
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
rot_dif = ee->rotation - rotation;
|
|
|
|
if (rot_dif < 0) rot_dif = -rot_dif;
|
2007-08-07 12:09:53 -07:00
|
|
|
|
|
|
|
if (rot_dif != 180)
|
|
|
|
{
|
2010-09-29 10:03:38 -07:00
|
|
|
int minw, minh, maxw, maxh, basew, baseh, stepw, steph;
|
2007-08-07 12:09:53 -07:00
|
|
|
|
2010-09-29 10:03:38 -07:00
|
|
|
if (!evas_engine_info_set(ee->evas, einfo))
|
2010-05-17 20:50:17 -07:00
|
|
|
{
|
|
|
|
ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
|
|
|
|
}
|
2010-02-10 06:35:07 -08:00
|
|
|
|
2010-09-29 10:03:38 -07:00
|
|
|
if (!resize)
|
2010-02-10 06:35:07 -08:00
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
edata->configure_coming = 1;
|
2010-02-10 06:35:07 -08:00
|
|
|
if (!ee->prop.fullscreen)
|
|
|
|
{
|
2010-02-27 06:40:10 -08:00
|
|
|
ecore_x_window_resize(ee->prop.window, ee->req.h, ee->req.w);
|
2010-02-10 06:35:07 -08:00
|
|
|
ee->expecting_resize.w = ee->h;
|
|
|
|
ee->expecting_resize.h = ee->w;
|
2012-09-13 03:20:17 -07:00
|
|
|
evas_output_size_set(ee->evas, ee->req.h, ee->req.w);
|
|
|
|
evas_output_viewport_set(ee->evas, 0, 0, ee->req.h, ee->req.w);
|
2010-02-10 06:35:07 -08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
int w, h;
|
2011-04-20 07:15:33 -07:00
|
|
|
|
2010-02-10 06:35:07 -08:00
|
|
|
ecore_x_window_size_get(ee->prop.window, &w, &h);
|
|
|
|
ecore_x_window_resize(ee->prop.window, h, w);
|
ecore_evas: Ecore_Evas_X - Fix broken rendering during rotation with resize
Summary:
When ee is trying to do rotation, ee should check whether given rotation value
is portrait or not. Then it sets output size of evas canvas according to rotation value.
But, ECORE_EVAS_PORTRAIT macro used in ee x engine only checks ee's rotation value, even
if ee's rotation value is not updated yet. Thus we should change the logic to compare with
given rotation value, not ee's rotation, before setting output size of evas.
This fixes T1371 problem.
@fix
Test Plan:
1. run elementary_test -to "window states"
2. check resize
3. rotation 0 ~ 270
Reviewers: jpeg, raster, cedric, zmike, devilhorns, Hermet
Reviewed By: Hermet
Subscribers: cedric
Maniphest Tasks: T1371
Differential Revision: https://phab.enlightenment.org/D1351
2014-08-27 03:35:27 -07:00
|
|
|
if (PORTRAIT_CHECK(rotation))
|
2010-02-10 06:35:07 -08:00
|
|
|
{
|
2010-02-27 06:40:10 -08:00
|
|
|
evas_output_size_set(ee->evas, ee->req.w, ee->req.h);
|
|
|
|
evas_output_viewport_set(ee->evas, 0, 0, ee->req.w, ee->req.h);
|
2010-02-10 06:35:07 -08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-02-27 06:40:10 -08:00
|
|
|
evas_output_size_set(ee->evas, ee->req.h, ee->req.w);
|
|
|
|
evas_output_viewport_set(ee->evas, 0, 0, ee->req.h, ee->req.w);
|
2010-02-10 06:35:07 -08:00
|
|
|
}
|
|
|
|
if (ee->func.fn_resize) ee->func.fn_resize(ee);
|
|
|
|
}
|
ecore_evas: Ecore_Evas_X - Fix broken rendering during rotation with resize
Summary:
When ee is trying to do rotation, ee should check whether given rotation value
is portrait or not. Then it sets output size of evas canvas according to rotation value.
But, ECORE_EVAS_PORTRAIT macro used in ee x engine only checks ee's rotation value, even
if ee's rotation value is not updated yet. Thus we should change the logic to compare with
given rotation value, not ee's rotation, before setting output size of evas.
This fixes T1371 problem.
@fix
Test Plan:
1. run elementary_test -to "window states"
2. check resize
3. rotation 0 ~ 270
Reviewers: jpeg, raster, cedric, zmike, devilhorns, Hermet
Reviewed By: Hermet
Subscribers: cedric
Maniphest Tasks: T1371
Differential Revision: https://phab.enlightenment.org/D1351
2014-08-27 03:35:27 -07:00
|
|
|
if (PORTRAIT_CHECK(rotation))
|
2010-02-27 06:40:10 -08:00
|
|
|
evas_damage_rectangle_add(ee->evas, 0, 0, ee->req.w, ee->req.h);
|
2014-01-18 05:26:10 -08:00
|
|
|
else
|
|
|
|
evas_damage_rectangle_add(ee->evas, 0, 0, ee->req.h, ee->req.w);
|
2010-02-10 06:35:07 -08:00
|
|
|
}
|
2010-09-29 10:03:38 -07:00
|
|
|
else
|
2010-02-10 06:35:07 -08:00
|
|
|
{
|
2011-09-21 14:01:15 -07:00
|
|
|
/* int w, h; */
|
2011-04-20 07:15:33 -07:00
|
|
|
|
2011-09-21 14:01:15 -07:00
|
|
|
/* ecore_x_window_size_get(ee->prop.window, &w, &h); */
|
ecore_evas: Ecore_Evas_X - Fix broken rendering during rotation with resize
Summary:
When ee is trying to do rotation, ee should check whether given rotation value
is portrait or not. Then it sets output size of evas canvas according to rotation value.
But, ECORE_EVAS_PORTRAIT macro used in ee x engine only checks ee's rotation value, even
if ee's rotation value is not updated yet. Thus we should change the logic to compare with
given rotation value, not ee's rotation, before setting output size of evas.
This fixes T1371 problem.
@fix
Test Plan:
1. run elementary_test -to "window states"
2. check resize
3. rotation 0 ~ 270
Reviewers: jpeg, raster, cedric, zmike, devilhorns, Hermet
Reviewed By: Hermet
Subscribers: cedric
Maniphest Tasks: T1371
Differential Revision: https://phab.enlightenment.org/D1351
2014-08-27 03:35:27 -07:00
|
|
|
if (PORTRAIT_CHECK(rotation))
|
2010-09-29 10:03:38 -07:00
|
|
|
{
|
|
|
|
evas_output_size_set(ee->evas, ee->w, ee->h);
|
|
|
|
evas_output_viewport_set(ee->evas, 0, 0, ee->w, ee->h);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
evas_output_size_set(ee->evas, ee->h, ee->w);
|
|
|
|
evas_output_viewport_set(ee->evas, 0, 0, ee->h, ee->w);
|
|
|
|
}
|
|
|
|
if (ee->func.fn_resize) ee->func.fn_resize(ee);
|
ecore_evas: Ecore_Evas_X - Fix broken rendering during rotation with resize
Summary:
When ee is trying to do rotation, ee should check whether given rotation value
is portrait or not. Then it sets output size of evas canvas according to rotation value.
But, ECORE_EVAS_PORTRAIT macro used in ee x engine only checks ee's rotation value, even
if ee's rotation value is not updated yet. Thus we should change the logic to compare with
given rotation value, not ee's rotation, before setting output size of evas.
This fixes T1371 problem.
@fix
Test Plan:
1. run elementary_test -to "window states"
2. check resize
3. rotation 0 ~ 270
Reviewers: jpeg, raster, cedric, zmike, devilhorns, Hermet
Reviewed By: Hermet
Subscribers: cedric
Maniphest Tasks: T1371
Differential Revision: https://phab.enlightenment.org/D1351
2014-08-27 03:35:27 -07:00
|
|
|
if (PORTRAIT_CHECK(rotation))
|
2010-02-27 06:40:10 -08:00
|
|
|
evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
|
2014-01-18 05:26:10 -08:00
|
|
|
else
|
|
|
|
evas_damage_rectangle_add(ee->evas, 0, 0, ee->h, ee->w);
|
2010-02-10 06:35:07 -08:00
|
|
|
}
|
2010-09-29 10:03:38 -07:00
|
|
|
ecore_evas_size_min_get(ee, &minw, &minh);
|
|
|
|
ecore_evas_size_max_get(ee, &maxw, &maxh);
|
|
|
|
ecore_evas_size_base_get(ee, &basew, &baseh);
|
|
|
|
ecore_evas_size_step_get(ee, &stepw, &steph);
|
|
|
|
ee->rotation = rotation;
|
|
|
|
ecore_evas_size_min_set(ee, minh, minw);
|
|
|
|
ecore_evas_size_max_set(ee, maxh, maxw);
|
|
|
|
ecore_evas_size_base_set(ee, baseh, basew);
|
|
|
|
ecore_evas_size_step_set(ee, steph, stepw);
|
|
|
|
_ecore_evas_mouse_move_process(ee, ee->mouse.x, ee->mouse.y,
|
|
|
|
ecore_x_current_time_get());
|
2007-08-07 12:09:53 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-09-29 10:03:38 -07:00
|
|
|
if (!evas_engine_info_set(ee->evas, einfo))
|
2010-05-17 20:50:17 -07:00
|
|
|
{
|
|
|
|
ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
|
|
|
|
}
|
2010-09-29 10:03:38 -07:00
|
|
|
ee->rotation = rotation;
|
|
|
|
_ecore_evas_mouse_move_process(ee, ee->mouse.x, ee->mouse.y,
|
|
|
|
ecore_x_current_time_get());
|
|
|
|
if (ee->func.fn_resize) ee->func.fn_resize(ee);
|
2011-04-20 07:15:33 -07:00
|
|
|
|
2014-01-18 05:26:10 -08:00
|
|
|
if (ECORE_EVAS_PORTRAIT(ee))
|
2010-02-27 06:40:10 -08:00
|
|
|
evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
|
2014-01-18 05:26:10 -08:00
|
|
|
else
|
|
|
|
evas_damage_rectangle_add(ee->evas, 0, 0, ee->h, ee->w);
|
2007-08-07 12:09:53 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-02-08 16:46:51 -08:00
|
|
|
static Eina_Bool
|
|
|
|
_ecore_evas_x_wm_rotation_check(Ecore_Evas *ee)
|
2012-07-03 00:44:17 -07:00
|
|
|
{
|
2014-02-08 16:46:51 -08:00
|
|
|
Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
|
|
|
|
if (ee->prop.wm_rot.supported)
|
|
|
|
{
|
|
|
|
if (ee->prop.wm_rot.app_set)
|
|
|
|
{
|
|
|
|
if (edata->wm_rot.request)
|
|
|
|
{
|
|
|
|
if (ee->prop.wm_rot.win_resize)
|
|
|
|
{
|
|
|
|
if (!((ee->w == ee->prop.wm_rot.w) &&
|
|
|
|
(ee->h == ee->prop.wm_rot.h)))
|
|
|
|
{
|
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
edata->wm_rot.configure_coming = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return EINA_TRUE;
|
2012-07-03 00:44:17 -07:00
|
|
|
}
|
|
|
|
|
2012-12-18 08:27:26 -08:00
|
|
|
static void
|
|
|
|
_rotation_do(Ecore_Evas *ee, int rotation, int resize)
|
|
|
|
{
|
|
|
|
#ifdef BUILD_ECORE_EVAS_SOFTWARE_X11
|
2014-02-08 16:46:51 -08:00
|
|
|
if (ee->prop.wm_rot.supported)
|
|
|
|
{
|
|
|
|
if (!_ecore_evas_x_wm_rotation_check(ee)) return;
|
|
|
|
if (!resize) resize = 1;
|
|
|
|
}
|
2012-12-18 08:27:26 -08:00
|
|
|
Evas_Engine_Info_Software_X11 *einfo;
|
|
|
|
Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
|
|
|
|
|
|
|
|
einfo = (Evas_Engine_Info_Software_X11 *)evas_engine_info_get(ee->evas);
|
|
|
|
if (!einfo) return;
|
|
|
|
einfo->info.rotation = rotation;
|
|
|
|
_ecore_evas_x_rotation_set_internal(ee, rotation, resize,
|
|
|
|
(Evas_Engine_Info *)einfo);
|
2014-02-08 16:46:51 -08:00
|
|
|
if (ee->prop.wm_rot.supported)
|
2012-12-18 08:27:26 -08:00
|
|
|
{
|
2014-02-08 16:46:51 -08:00
|
|
|
if (ee->prop.wm_rot.app_set)
|
|
|
|
{
|
|
|
|
if (edata->wm_rot.request)
|
|
|
|
{
|
|
|
|
if (ee->func.fn_state_change) ee->func.fn_state_change(ee);
|
|
|
|
edata->wm_rot.request = 0;
|
|
|
|
edata->wm_rot.done = 1;
|
|
|
|
}
|
|
|
|
}
|
2012-12-18 08:27:26 -08:00
|
|
|
}
|
2014-02-08 16:46:51 -08:00
|
|
|
|
|
|
|
int angles[2] = { rotation, rotation };
|
2012-12-18 08:27:26 -08:00
|
|
|
ecore_x_window_prop_property_set(ee->prop.window,
|
|
|
|
ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE,
|
2014-02-08 16:46:51 -08:00
|
|
|
ECORE_X_ATOM_CARDINAL, 32, &angles, 2);
|
2012-12-18 08:27:26 -08:00
|
|
|
#endif /* BUILD_ECORE_EVAS_SOFTWARE_X11 */
|
|
|
|
}
|
|
|
|
|
2007-08-07 12:09:53 -07:00
|
|
|
static void
|
2010-02-10 06:35:07 -08:00
|
|
|
_ecore_evas_x_rotation_set(Ecore_Evas *ee, int rotation, int resize)
|
2007-08-07 12:09:53 -07:00
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
|
|
|
|
|
2014-02-08 16:46:51 -08:00
|
|
|
if (ee->rotation == rotation)
|
|
|
|
{
|
|
|
|
if (ee->prop.wm_rot.supported)
|
|
|
|
{
|
|
|
|
if (edata->wm_rot.request)
|
|
|
|
{
|
|
|
|
if (ee->prop.wm_rot.manual_mode.set)
|
|
|
|
{
|
|
|
|
ee->prop.wm_rot.manual_mode.wait_for_done = EINA_FALSE;
|
|
|
|
if (ee->prop.wm_rot.manual_mode.timer)
|
|
|
|
ecore_timer_del(ee->prop.wm_rot.manual_mode.timer);
|
|
|
|
ee->prop.wm_rot.manual_mode.timer = NULL;
|
|
|
|
}
|
|
|
|
/* send rotation done message to wm, even if window is already rotated.
|
|
|
|
* that's why wm must be wait for comming rotation done message
|
|
|
|
* after sending rotation request.
|
|
|
|
*/
|
|
|
|
ecore_x_e_window_rotation_change_done_send
|
|
|
|
(edata->win_root, ee->prop.window, ee->rotation, ee->w, ee->h);
|
|
|
|
edata->wm_rot.request = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
2012-07-03 00:44:17 -07:00
|
|
|
|
2014-02-08 16:46:51 -08:00
|
|
|
if (ee->prop.wm_rot.supported)
|
|
|
|
{
|
|
|
|
if (!_ecore_evas_x_wm_rotation_check(ee)) return;
|
|
|
|
if (!resize) resize = 1;
|
|
|
|
}
|
2012-03-07 06:34:24 -08:00
|
|
|
|
2010-05-08 22:15:55 -07:00
|
|
|
if (!strcmp(ee->driver, "opengl_x11"))
|
|
|
|
{
|
2010-05-08 22:51:10 -07:00
|
|
|
#ifdef BUILD_ECORE_EVAS_OPENGL_X11
|
2010-09-29 10:03:38 -07:00
|
|
|
Evas_Engine_Info_GL_X11 *einfo;
|
2010-05-08 22:15:55 -07:00
|
|
|
|
2010-09-29 10:03:38 -07:00
|
|
|
einfo = (Evas_Engine_Info_GL_X11 *)evas_engine_info_get(ee->evas);
|
|
|
|
if (!einfo) return;
|
|
|
|
einfo->info.rotation = rotation;
|
2011-09-21 23:02:26 -07:00
|
|
|
_ecore_evas_x_rotation_set_internal(ee, rotation, resize,
|
2011-07-26 04:24:10 -07:00
|
|
|
(Evas_Engine_Info *)einfo);
|
2014-02-08 16:46:51 -08:00
|
|
|
if (ee->prop.wm_rot.supported)
|
|
|
|
{
|
|
|
|
if (ee->prop.wm_rot.app_set)
|
|
|
|
{
|
|
|
|
if (edata->wm_rot.request)
|
|
|
|
{
|
|
|
|
if (ee->func.fn_state_change) ee->func.fn_state_change(ee);
|
|
|
|
edata->wm_rot.request = 0;
|
|
|
|
edata->wm_rot.done = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
int angles[2] = { rotation, rotation };
|
2012-03-07 06:34:24 -08:00
|
|
|
ecore_x_window_prop_property_set(ee->prop.window,
|
|
|
|
ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE,
|
|
|
|
ECORE_X_ATOM_CARDINAL, 32, &angles, 2);
|
2010-05-08 23:03:46 -07:00
|
|
|
#endif /* BUILD_ECORE_EVAS_OPENGL_X11 */
|
2010-05-08 22:15:55 -07:00
|
|
|
}
|
2010-05-08 23:03:46 -07:00
|
|
|
else if (!strcmp(ee->driver, "software_x11"))
|
Here is ecore_x with XCB backend.
* The XCB backend is disabled by default during the
configuration. To enable it, add --enable-ecore-x-xcb. See the
messages that configure displays when it finishes.
* The way XCB is detected, and used in src/lib/ecore_x/Makefile.am
should be improved
* Any program that uses ecore_evas does not need to be modified.
Any program that uses ecore_x may need some changes. That is,
adding some functions (_prefetch and _fetch ones). No other
change is needed. See the documention of any _get functions, as
these are the ones that need those functions.
* There are some missing parts, especially everything that involves
the keyboard, as porting Xlib functions related to strings (utf8
stuff, XKeysymToString, etc...) is an horror. So keyboard events
are not working yet.
* I tried to write as much documentation as I could. But there is
certainly some missing doc here and there.
there are certainly other things that I have forgotten.
Improvements of that backend:
* the creation of an ecore_evas is faster. Especially when done over
an ssh connection (on my computer, 7-10s with Xlib, 1.5s with XCB,
over an ssh)
* A Window Manager should be more responsive. But it's not tomorrow
that e17 will use it :)
Have fun !
SVN revision: 29500
2007-04-13 10:15:19 -07:00
|
|
|
{
|
2012-12-18 08:27:26 -08:00
|
|
|
if (ee->in_async_render)
|
|
|
|
{
|
|
|
|
ee->delayed.rotation = rotation;
|
|
|
|
ee->delayed.rotation_resize = resize;
|
|
|
|
ee->delayed.rotation_changed = EINA_TRUE;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
_rotation_do(ee, rotation, resize);
|
|
|
|
return;
|
2003-09-23 01:09:32 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-12-18 08:27:26 -08:00
|
|
|
_shaped_do(Ecore_Evas *ee, int shaped)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
2012-12-18 08:27:26 -08:00
|
|
|
#ifdef BUILD_ECORE_EVAS_SOFTWARE_X11
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
|
2012-12-18 08:27:26 -08:00
|
|
|
Evas_Engine_Info_Software_X11 *einfo;
|
2012-12-05 13:15:42 -08:00
|
|
|
|
2013-01-20 16:22:35 -08:00
|
|
|
if (ee->shaped == shaped) return;
|
2012-12-18 08:27:26 -08:00
|
|
|
einfo = (Evas_Engine_Info_Software_X11 *)evas_engine_info_get(ee->evas);
|
|
|
|
ee->shaped = shaped;
|
|
|
|
if (einfo)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
2012-12-18 08:27:26 -08:00
|
|
|
if (ee->shaped)
|
2010-09-29 10:03:38 -07:00
|
|
|
{
|
2012-12-18 08:27:26 -08:00
|
|
|
unsigned int foreground;
|
|
|
|
Ecore_X_GC gc;
|
|
|
|
|
|
|
|
if (!edata->mask)
|
|
|
|
edata->mask = ecore_x_pixmap_new(ee->prop.window, ee->w, ee->h, 1);
|
|
|
|
foreground = 0;
|
|
|
|
gc = ecore_x_gc_new(edata->mask,
|
|
|
|
ECORE_X_GC_VALUE_MASK_FOREGROUND,
|
|
|
|
&foreground);
|
|
|
|
ecore_x_drawable_rectangle_fill(edata->mask, gc,
|
|
|
|
0, 0, ee->w, ee->h);
|
|
|
|
ecore_x_gc_free(gc);
|
|
|
|
einfo->info.mask = edata->mask;
|
|
|
|
if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
|
2010-09-29 10:03:38 -07:00
|
|
|
{
|
2012-12-18 08:27:26 -08:00
|
|
|
ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
|
2010-09-29 10:03:38 -07:00
|
|
|
}
|
2012-12-18 08:27:26 -08:00
|
|
|
evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
|
|
|
|
ecore_x_window_shape_input_mask_set(ee->prop.window, 0);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (edata->mask) ecore_x_pixmap_free(edata->mask);
|
|
|
|
edata->mask = 0;
|
|
|
|
einfo->info.mask = 0;
|
|
|
|
if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
|
2010-09-29 10:03:38 -07:00
|
|
|
{
|
2012-12-18 08:27:26 -08:00
|
|
|
ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
|
2010-09-29 10:03:38 -07:00
|
|
|
}
|
2012-12-18 08:27:26 -08:00
|
|
|
ecore_x_window_shape_mask_set(ee->prop.window, 0);
|
|
|
|
ecore_x_window_shape_input_mask_set(ee->prop.window, 0);
|
2010-09-29 10:03:38 -07:00
|
|
|
}
|
2012-12-18 08:27:26 -08:00
|
|
|
}
|
2009-07-14 14:18:27 -07:00
|
|
|
#endif /* BUILD_ECORE_EVAS_SOFTWARE_X11 */
|
2012-12-18 08:27:26 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_ecore_evas_x_shaped_set(Ecore_Evas *ee, int shaped)
|
|
|
|
{
|
|
|
|
if (!strcmp(ee->driver, "opengl_x11")) return;
|
|
|
|
if (!strcmp(ee->driver, "software_x11"))
|
|
|
|
{
|
|
|
|
if (ee->in_async_render)
|
|
|
|
{
|
|
|
|
ee->delayed.shaped = shaped;
|
|
|
|
ee->delayed.shaped_changed = EINA_TRUE;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
_shaped_do(ee, shaped);
|
2005-10-02 23:45:45 -07:00
|
|
|
}
|
2003-09-23 01:09:32 -07:00
|
|
|
}
|
|
|
|
|
2006-03-08 00:02:55 -08:00
|
|
|
static void
|
2012-12-18 08:27:26 -08:00
|
|
|
_alpha_do(Ecore_Evas *ee, int alpha)
|
2006-03-08 00:02:55 -08:00
|
|
|
{
|
2011-07-26 04:24:10 -07:00
|
|
|
char *id = NULL;
|
2012-12-18 08:27:26 -08:00
|
|
|
#ifdef BUILD_ECORE_EVAS_SOFTWARE_X11
|
|
|
|
Ecore_X_Window_Attributes att;
|
|
|
|
Evas_Engine_Info_Software_X11 *einfo;
|
|
|
|
Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
|
2007-05-12 07:13:19 -07:00
|
|
|
|
2013-01-20 16:22:35 -08:00
|
|
|
if (ee->alpha == alpha) return;
|
2007-05-12 07:13:19 -07:00
|
|
|
|
2012-12-18 08:27:26 -08:00
|
|
|
einfo = (Evas_Engine_Info_Software_X11 *)evas_engine_info_get(ee->evas);
|
|
|
|
if (!einfo) return;
|
2010-09-29 10:03:38 -07:00
|
|
|
|
2012-12-18 08:27:26 -08:00
|
|
|
if (!ecore_x_composite_query()) return;
|
2010-09-29 10:03:38 -07:00
|
|
|
|
2012-12-18 08:27:26 -08:00
|
|
|
ee->shaped = 0;
|
|
|
|
ee->alpha = alpha;
|
2013-03-22 02:49:46 -07:00
|
|
|
_ecore_evas_x_sync_clear(ee);
|
2012-12-18 08:27:26 -08:00
|
|
|
ecore_x_window_free(ee->prop.window);
|
|
|
|
ecore_event_window_unregister(ee->prop.window);
|
|
|
|
if (ee->alpha)
|
|
|
|
{
|
|
|
|
if (ee->prop.override)
|
|
|
|
ee->prop.window = ecore_x_window_override_argb_new(edata->win_root, ee->req.x, ee->req.y, ee->req.w, ee->req.h);
|
2010-09-29 10:03:38 -07:00
|
|
|
else
|
2012-12-18 08:27:26 -08:00
|
|
|
ee->prop.window = ecore_x_window_argb_new(edata->win_root, ee->req.x, ee->req.y, ee->req.w, ee->req.h);
|
|
|
|
// if (!edata->mask)
|
|
|
|
// edata->mask = ecore_x_pixmap_new(ee->prop.window, ee->req.w, ee->req.h, 1);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (ee->prop.override)
|
|
|
|
ee->prop.window = ecore_x_window_override_new(edata->win_root, ee->req.x, ee->req.y, ee->req.w, ee->req.h);
|
|
|
|
else
|
|
|
|
ee->prop.window = ecore_x_window_new(edata->win_root, ee->req.x, ee->req.y, ee->req.w, ee->req.h);
|
|
|
|
if (edata->mask) ecore_x_pixmap_free(edata->mask);
|
|
|
|
edata->mask = 0;
|
|
|
|
ecore_x_window_shape_input_mask_set(ee->prop.window, 0);
|
2014-07-24 22:45:50 -07:00
|
|
|
ecore_x_vsync_animator_tick_source_set(ee->prop.window);
|
2012-12-18 08:27:26 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
einfo->info.destination_alpha = alpha;
|
|
|
|
|
|
|
|
ecore_x_window_attributes_get(ee->prop.window, &att);
|
|
|
|
einfo->info.visual = att.visual;
|
|
|
|
einfo->info.colormap = att.colormap;
|
|
|
|
einfo->info.depth = att.depth;
|
|
|
|
|
|
|
|
// if (edata->mask) ecore_x_pixmap_free(edata->mask);
|
|
|
|
// edata->mask = 0;
|
|
|
|
einfo->info.mask = edata->mask;
|
|
|
|
einfo->info.drawable = ee->prop.window;
|
|
|
|
if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
|
|
|
|
{
|
|
|
|
ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
|
|
|
|
}
|
|
|
|
evas_damage_rectangle_add(ee->evas, 0, 0, ee->req.w, ee->req.h);
|
|
|
|
ecore_x_window_shape_mask_set(ee->prop.window, 0);
|
2015-02-04 01:58:48 -08:00
|
|
|
ecore_x_input_multi_select(ee->prop.window);
|
2012-12-18 08:27:26 -08:00
|
|
|
ecore_event_window_register(ee->prop.window, ee, ee->evas,
|
|
|
|
(Ecore_Event_Mouse_Move_Cb)_ecore_evas_mouse_move_process,
|
|
|
|
(Ecore_Event_Multi_Move_Cb)_ecore_evas_mouse_multi_move_process,
|
|
|
|
(Ecore_Event_Multi_Down_Cb)_ecore_evas_mouse_multi_down_process,
|
|
|
|
(Ecore_Event_Multi_Up_Cb)_ecore_evas_mouse_multi_up_process);
|
|
|
|
if (ee->prop.borderless)
|
|
|
|
ecore_x_mwm_borderless_set(ee->prop.window, ee->prop.borderless);
|
2013-12-17 03:37:17 -08:00
|
|
|
if (ee->visible || ee->should_be_visible)
|
|
|
|
ecore_x_window_show(ee->prop.window);
|
2012-12-18 08:27:26 -08:00
|
|
|
if (ee->prop.focused) ecore_x_window_focus(ee->prop.window);
|
|
|
|
if (ee->prop.title)
|
|
|
|
{
|
|
|
|
ecore_x_icccm_title_set(ee->prop.window, ee->prop.title);
|
|
|
|
ecore_x_netwm_name_set(ee->prop.window, ee->prop.title);
|
|
|
|
}
|
|
|
|
if (ee->prop.name)
|
|
|
|
ecore_x_icccm_name_class_set(ee->prop.window,
|
|
|
|
ee->prop.name, ee->prop.clas);
|
|
|
|
_ecore_evas_x_hints_update(ee);
|
|
|
|
_ecore_evas_x_group_leader_update(ee);
|
|
|
|
ecore_x_window_defaults_set(ee->prop.window);
|
|
|
|
_ecore_evas_x_protocols_set(ee);
|
|
|
|
_ecore_evas_x_window_profile_protocol_set(ee);
|
2014-02-08 16:46:51 -08:00
|
|
|
_ecore_evas_x_wm_rotation_protocol_set(ee);
|
2014-02-27 14:20:01 -08:00
|
|
|
_ecore_evas_x_aux_hints_supprted_update(ee);
|
|
|
|
_ecore_evas_x_aux_hints_update(ee);
|
2012-12-18 08:27:26 -08:00
|
|
|
_ecore_evas_x_sync_set(ee);
|
|
|
|
_ecore_evas_x_size_pos_hints_update(ee);
|
|
|
|
#endif /* BUILD_ECORE_EVAS_SOFTWARE_X11 */
|
|
|
|
if ((id = getenv("DESKTOP_STARTUP_ID")))
|
|
|
|
{
|
|
|
|
ecore_x_netwm_startup_id_set(ee->prop.window, id);
|
|
|
|
/* NB: on linux this may simply empty the env as opposed to completely
|
|
|
|
* unset it to being empty - unsure as solartis libc crashes looking
|
|
|
|
* for the '=' char */
|
|
|
|
// putenv((char*)"DESKTOP_STARTUP_ID=");
|
|
|
|
}
|
|
|
|
}
|
2007-05-12 07:13:19 -07:00
|
|
|
|
2012-12-18 08:27:26 -08:00
|
|
|
/* FIXME, round trip */
|
|
|
|
static void
|
|
|
|
_ecore_evas_x_alpha_set(Ecore_Evas *ee, int alpha)
|
|
|
|
{
|
|
|
|
char *id = NULL;
|
2007-05-12 07:13:19 -07:00
|
|
|
|
2012-12-18 08:27:26 -08:00
|
|
|
if (!strcmp(ee->driver, "software_x11"))
|
|
|
|
{
|
|
|
|
if (ee->in_async_render)
|
2010-02-28 20:44:36 -08:00
|
|
|
{
|
2013-10-16 08:00:05 -07:00
|
|
|
if (ee->visible)
|
|
|
|
{
|
|
|
|
ee->delayed.alpha = alpha;
|
|
|
|
ee->delayed.alpha_changed = EINA_TRUE;
|
|
|
|
return;
|
|
|
|
}
|
2013-10-16 09:57:07 -07:00
|
|
|
evas_sync(ee->evas);
|
2010-02-28 20:44:36 -08:00
|
|
|
}
|
2012-12-18 08:27:26 -08:00
|
|
|
_alpha_do(ee, alpha);
|
2010-02-28 20:44:36 -08:00
|
|
|
}
|
|
|
|
else if (!strcmp(ee->driver, "opengl_x11"))
|
|
|
|
{
|
|
|
|
#ifdef BUILD_ECORE_EVAS_OPENGL_X11
|
2014-05-30 05:26:55 -07:00
|
|
|
Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
|
2014-05-30 05:24:42 -07:00
|
|
|
Ecore_X_Window_Attributes att;
|
2013-01-20 16:22:35 -08:00
|
|
|
if (ee->alpha == alpha) return;
|
2012-12-18 08:27:26 -08:00
|
|
|
|
2010-09-29 10:03:38 -07:00
|
|
|
Evas_Engine_Info_GL_X11 *einfo;
|
2014-01-12 00:22:40 -08:00
|
|
|
Ecore_Window prev_win;
|
2010-02-28 20:44:36 -08:00
|
|
|
|
2010-09-29 10:03:38 -07:00
|
|
|
einfo = (Evas_Engine_Info_GL_X11 *)evas_engine_info_get(ee->evas);
|
|
|
|
if (!einfo) return;
|
2010-02-28 20:44:36 -08:00
|
|
|
|
2010-09-29 10:03:38 -07:00
|
|
|
if (!ecore_x_composite_query()) return;
|
2010-02-28 20:44:36 -08:00
|
|
|
|
2010-09-29 10:03:38 -07:00
|
|
|
ee->shaped = 0;
|
|
|
|
ee->alpha = alpha;
|
2013-03-22 02:49:46 -07:00
|
|
|
_ecore_evas_x_sync_clear(ee);
|
2014-01-12 00:22:40 -08:00
|
|
|
prev_win = ee->prop.window;
|
2010-03-01 04:01:57 -08:00
|
|
|
ee->prop.window = 0;
|
2011-04-20 07:15:33 -07:00
|
|
|
|
2010-09-29 10:03:38 -07:00
|
|
|
einfo->info.destination_alpha = alpha;
|
2011-04-20 07:15:33 -07:00
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
if (edata->win_root != 0)
|
2010-02-28 20:44:36 -08:00
|
|
|
{
|
|
|
|
/* FIXME: round trip in ecore_x_window_argb_get */
|
2012-12-05 13:15:42 -08:00
|
|
|
if (ecore_x_window_argb_get(edata->win_root))
|
2010-02-28 20:44:36 -08:00
|
|
|
{
|
2011-09-21 23:02:26 -07:00
|
|
|
ee->prop.window =
|
2012-12-05 13:15:42 -08:00
|
|
|
_ecore_evas_x_gl_window_new(ee, edata->win_root,
|
2011-09-21 23:02:26 -07:00
|
|
|
ee->req.x, ee->req.y,
|
2011-07-26 04:24:10 -07:00
|
|
|
ee->req.w, ee->req.h,
|
|
|
|
ee->prop.override, 1, NULL);
|
|
|
|
}
|
2011-09-21 23:02:26 -07:00
|
|
|
else
|
2011-07-26 04:24:10 -07:00
|
|
|
{
|
2011-09-21 23:02:26 -07:00
|
|
|
ee->prop.window =
|
2012-12-05 13:15:42 -08:00
|
|
|
_ecore_evas_x_gl_window_new(ee, edata->win_root,
|
2011-09-21 23:02:26 -07:00
|
|
|
ee->req.x, ee->req.y,
|
2011-07-26 04:24:10 -07:00
|
|
|
ee->req.w, ee->req.h,
|
2011-09-21 23:02:26 -07:00
|
|
|
ee->prop.override, ee->alpha,
|
2011-07-26 04:24:10 -07:00
|
|
|
NULL);
|
2010-02-28 20:44:36 -08:00
|
|
|
}
|
|
|
|
}
|
2011-09-21 23:02:26 -07:00
|
|
|
else
|
2010-05-17 20:50:17 -07:00
|
|
|
{
|
2011-09-21 23:02:26 -07:00
|
|
|
ee->prop.window =
|
2012-12-05 13:15:42 -08:00
|
|
|
_ecore_evas_x_gl_window_new(ee, edata->win_root,
|
2011-09-21 23:02:26 -07:00
|
|
|
ee->req.x, ee->req.y,
|
2011-07-26 04:24:10 -07:00
|
|
|
ee->req.w, ee->req.h,
|
|
|
|
ee->prop.override, ee->alpha, NULL);
|
2010-05-17 20:50:17 -07:00
|
|
|
}
|
2011-07-26 04:24:10 -07:00
|
|
|
|
2014-01-12 00:22:40 -08:00
|
|
|
ecore_x_window_free(prev_win);
|
|
|
|
ecore_event_window_unregister(prev_win);
|
|
|
|
|
2011-07-26 04:24:10 -07:00
|
|
|
if (!ee->prop.window) return;
|
2011-04-20 07:15:33 -07:00
|
|
|
/*
|
2010-09-29 10:03:38 -07:00
|
|
|
if (ee->alpha)
|
|
|
|
{
|
|
|
|
if (ee->prop.override)
|
2012-12-05 13:15:42 -08:00
|
|
|
ee->prop.window = ecore_x_window_override_argb_new(edata->win_root, ee->req.x, ee->req.y, ee->req.w, ee->req.h);
|
2010-09-29 10:03:38 -07:00
|
|
|
else
|
2012-12-05 13:15:42 -08:00
|
|
|
ee->prop.window = ecore_x_window_argb_new(edata->win_root, ee->req.x, ee->req.y, ee->req.w, ee->req.h);
|
|
|
|
if (!edata->mask)
|
|
|
|
edata->mask = ecore_x_pixmap_new(ee->prop.window, ee->req.w, ee->req.h, 1);
|
2010-09-29 10:03:38 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (ee->prop.override)
|
2012-12-05 13:15:42 -08:00
|
|
|
ee->prop.window = ecore_x_window_override_new(edata->win_root, ee->req.x, ee->req.y, ee->req.w, ee->req.h);
|
2010-09-29 10:03:38 -07:00
|
|
|
else
|
2012-12-05 13:15:42 -08:00
|
|
|
ee->prop.window = ecore_x_window_new(edata->win_root, ee->req.x, ee->req.y, ee->req.w, ee->req.h);
|
|
|
|
if (edata->mask) ecore_x_pixmap_free(edata->mask);
|
|
|
|
edata->mask = 0;
|
2010-09-29 10:03:38 -07:00
|
|
|
ecore_x_window_shape_input_mask_set(ee->prop.window, 0);
|
|
|
|
}
|
2010-02-28 20:44:36 -08:00
|
|
|
*/
|
|
|
|
|
2011-07-25 02:29:09 -07:00
|
|
|
ecore_x_window_attributes_get(ee->prop.window, &att);
|
2010-09-29 10:03:38 -07:00
|
|
|
einfo->info.visual = att.visual;
|
|
|
|
einfo->info.colormap = att.colormap;
|
|
|
|
einfo->info.depth = att.depth;
|
2010-02-28 20:44:36 -08:00
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
// if (edata->mask) ecore_x_pixmap_free(edata->mask);
|
|
|
|
// edata->mask = 0;
|
|
|
|
// einfo->info.mask = edata->mask;
|
2010-09-29 10:03:38 -07:00
|
|
|
einfo->info.drawable = ee->prop.window;
|
2010-05-17 20:50:17 -07:00
|
|
|
if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
|
|
|
|
{
|
|
|
|
ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
|
|
|
|
}
|
2010-09-29 10:03:38 -07:00
|
|
|
evas_damage_rectangle_add(ee->evas, 0, 0, ee->req.w, ee->req.h);
|
|
|
|
// ecore_x_window_shape_mask_set(ee->prop.window, 0);
|
2015-02-04 01:58:48 -08:00
|
|
|
ecore_x_input_multi_select(ee->prop.window);
|
2010-12-07 19:25:23 -08:00
|
|
|
ecore_event_window_register(ee->prop.window, ee, ee->evas,
|
|
|
|
(Ecore_Event_Mouse_Move_Cb)_ecore_evas_mouse_move_process,
|
|
|
|
(Ecore_Event_Multi_Move_Cb)_ecore_evas_mouse_multi_move_process,
|
|
|
|
(Ecore_Event_Multi_Down_Cb)_ecore_evas_mouse_multi_down_process,
|
|
|
|
(Ecore_Event_Multi_Up_Cb)_ecore_evas_mouse_multi_up_process);
|
2010-09-29 10:03:38 -07:00
|
|
|
if (ee->prop.borderless)
|
|
|
|
ecore_x_mwm_borderless_set(ee->prop.window, ee->prop.borderless);
|
2013-12-17 03:37:17 -08:00
|
|
|
if (ee->visible || ee->should_be_visible)
|
|
|
|
ecore_x_window_show(ee->prop.window);
|
2010-09-29 10:03:38 -07:00
|
|
|
if (ee->prop.focused) ecore_x_window_focus(ee->prop.window);
|
|
|
|
if (ee->prop.title)
|
|
|
|
{
|
|
|
|
ecore_x_icccm_title_set(ee->prop.window, ee->prop.title);
|
|
|
|
ecore_x_netwm_name_set(ee->prop.window, ee->prop.title);
|
|
|
|
}
|
2012-06-17 00:24:11 -07:00
|
|
|
if (ee->prop.name)
|
|
|
|
ecore_x_icccm_name_class_set(ee->prop.window,
|
|
|
|
ee->prop.name, ee->prop.clas);
|
2012-02-27 22:43:59 -08:00
|
|
|
_ecore_evas_x_hints_update(ee);
|
2010-10-01 18:56:23 -07:00
|
|
|
_ecore_evas_x_group_leader_update(ee);
|
|
|
|
ecore_x_window_defaults_set(ee->prop.window);
|
2010-02-28 20:44:36 -08:00
|
|
|
_ecore_evas_x_protocols_set(ee);
|
2012-12-04 22:48:46 -08:00
|
|
|
_ecore_evas_x_window_profile_protocol_set(ee);
|
2014-02-08 16:46:51 -08:00
|
|
|
_ecore_evas_x_wm_rotation_protocol_set(ee);
|
2014-02-27 14:20:01 -08:00
|
|
|
_ecore_evas_x_aux_hints_supprted_update(ee);
|
|
|
|
_ecore_evas_x_aux_hints_update(ee);
|
2010-02-28 20:44:36 -08:00
|
|
|
_ecore_evas_x_sync_set(ee);
|
2012-06-16 19:37:18 -07:00
|
|
|
_ecore_evas_x_size_pos_hints_update(ee);
|
2010-02-28 20:44:36 -08:00
|
|
|
#endif /* BUILD_ECORE_EVAS_OPENGL_X11 */
|
2011-07-26 04:24:10 -07:00
|
|
|
if ((id = getenv("DESKTOP_STARTUP_ID")))
|
2010-02-28 20:44:36 -08:00
|
|
|
{
|
2011-07-26 04:24:10 -07:00
|
|
|
ecore_x_netwm_startup_id_set(ee->prop.window, id);
|
2010-02-28 20:44:36 -08:00
|
|
|
/* NB: on linux this may simply empty the env as opposed to completely
|
|
|
|
* unset it to being empty - unsure as solartis libc crashes looking
|
|
|
|
* for the '=' char */
|
2010-09-29 10:03:38 -07:00
|
|
|
// putenv((char*)"DESKTOP_STARTUP_ID=");
|
2010-02-28 20:44:36 -08:00
|
|
|
}
|
2006-03-08 19:51:43 -08:00
|
|
|
}
|
2006-03-08 00:02:55 -08:00
|
|
|
}
|
2010-02-11 21:31:26 -08:00
|
|
|
|
|
|
|
static void
|
2012-12-18 08:27:26 -08:00
|
|
|
_transparent_do(Ecore_Evas *ee, int transparent)
|
2010-02-11 21:31:26 -08:00
|
|
|
{
|
2012-12-18 08:27:26 -08:00
|
|
|
#ifdef BUILD_ECORE_EVAS_SOFTWARE_X11
|
2013-01-20 16:22:35 -08:00
|
|
|
if (ee->transparent == transparent) return;
|
2010-02-11 21:31:26 -08:00
|
|
|
|
2012-12-18 08:27:26 -08:00
|
|
|
Evas_Engine_Info_Software_X11 *einfo;
|
2010-02-11 21:31:26 -08:00
|
|
|
|
2012-12-18 08:27:26 -08:00
|
|
|
einfo = (Evas_Engine_Info_Software_X11 *)evas_engine_info_get(ee->evas);
|
|
|
|
if (!einfo) return;
|
2010-02-11 21:31:26 -08:00
|
|
|
|
2012-12-18 08:27:26 -08:00
|
|
|
ee->transparent = transparent;
|
|
|
|
einfo->info.destination_alpha = transparent;
|
|
|
|
if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
|
|
|
|
{
|
|
|
|
ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
|
|
|
|
}
|
|
|
|
evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_ecore_evas_x_transparent_set(Ecore_Evas *ee, int transparent)
|
|
|
|
{
|
|
|
|
if (!strcmp(ee->driver, "software_x11"))
|
|
|
|
{
|
|
|
|
if (ee->in_async_render)
|
2010-05-17 20:50:17 -07:00
|
|
|
{
|
2012-12-18 08:27:26 -08:00
|
|
|
ee->delayed.transparent = transparent;
|
|
|
|
ee->delayed.transparent_changed = EINA_TRUE;
|
|
|
|
return;
|
2010-05-17 20:50:17 -07:00
|
|
|
}
|
2012-12-18 08:27:26 -08:00
|
|
|
_transparent_do(ee, transparent);
|
2010-02-11 21:31:26 -08:00
|
|
|
}
|
|
|
|
}
|
2012-02-27 22:43:59 -08:00
|
|
|
|
|
|
|
static void
|
|
|
|
_ecore_evas_x_window_group_set(Ecore_Evas *ee, const Ecore_Evas *group_ee)
|
|
|
|
{
|
|
|
|
if (ee->prop.group_ee == group_ee) return;
|
|
|
|
|
|
|
|
ee->prop.group_ee = (Ecore_Evas *)group_ee;
|
|
|
|
if (ee->prop.group_ee)
|
|
|
|
ee->prop.group_ee_win = group_ee->prop.window;
|
|
|
|
else
|
|
|
|
ee->prop.group_ee_win = 0;
|
|
|
|
_ecore_evas_x_hints_update(ee);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_ecore_evas_x_aspect_set(Ecore_Evas *ee, double aspect)
|
|
|
|
{
|
|
|
|
if (ee->prop.aspect == aspect) return;
|
|
|
|
|
|
|
|
ee->prop.aspect = aspect;
|
|
|
|
_ecore_evas_x_size_pos_hints_update(ee);
|
|
|
|
// netwm state
|
|
|
|
// if (ee->should_be_visible)
|
|
|
|
// ecore_x_netwm_state_request_send(ee->prop.window, ee->engine.x.win_root,
|
|
|
|
// ECORE_X_WINDOW_STATE_STICKY, -1, sticky);
|
|
|
|
// else
|
|
|
|
// _ecore_evas_x_state_update(ee);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2014-01-12 21:26:36 -08:00
|
|
|
_ecore_evas_x_urgent_set(Ecore_Evas *ee, Eina_Bool on)
|
2012-02-27 22:43:59 -08:00
|
|
|
{
|
2014-01-12 21:26:36 -08:00
|
|
|
if (ee->prop.urgent == on) return;
|
2012-02-27 22:43:59 -08:00
|
|
|
|
2014-01-12 21:26:36 -08:00
|
|
|
ee->prop.urgent = on;
|
2012-02-27 22:43:59 -08:00
|
|
|
_ecore_evas_x_hints_update(ee);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2014-01-12 21:26:36 -08:00
|
|
|
_ecore_evas_x_modal_set(Ecore_Evas *ee, Eina_Bool on)
|
2012-02-27 22:43:59 -08:00
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
|
|
|
|
|
2014-01-12 21:26:36 -08:00
|
|
|
if (ee->prop.modal == on) return;
|
2012-02-27 22:43:59 -08:00
|
|
|
|
2014-01-12 21:26:36 -08:00
|
|
|
ee->prop.modal = on;
|
2012-02-27 22:43:59 -08:00
|
|
|
if (ee->should_be_visible)
|
2012-12-05 13:15:42 -08:00
|
|
|
ecore_x_netwm_state_request_send(ee->prop.window, edata->win_root,
|
2014-01-12 21:26:36 -08:00
|
|
|
ECORE_X_WINDOW_STATE_MODAL, -1, on);
|
2012-02-27 22:43:59 -08:00
|
|
|
else
|
|
|
|
_ecore_evas_x_state_update(ee);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2014-01-12 21:26:36 -08:00
|
|
|
_ecore_evas_x_demand_attention_set(Ecore_Evas *ee, Eina_Bool on)
|
2012-02-27 22:43:59 -08:00
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
|
|
|
|
|
2014-01-12 21:26:36 -08:00
|
|
|
if (ee->prop.demand_attention == on) return;
|
2012-02-27 22:43:59 -08:00
|
|
|
|
2014-01-12 21:26:36 -08:00
|
|
|
ee->prop.demand_attention = on;
|
2012-02-27 22:43:59 -08:00
|
|
|
if (ee->should_be_visible)
|
2012-12-05 13:15:42 -08:00
|
|
|
ecore_x_netwm_state_request_send(ee->prop.window, edata->win_root,
|
2014-01-12 21:26:36 -08:00
|
|
|
ECORE_X_WINDOW_STATE_DEMANDS_ATTENTION,
|
|
|
|
-1, on);
|
2012-02-27 22:43:59 -08:00
|
|
|
else
|
|
|
|
_ecore_evas_x_state_update(ee);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2014-01-12 21:26:36 -08:00
|
|
|
_ecore_evas_x_focus_skip_set(Ecore_Evas *ee, Eina_Bool on)
|
2012-02-27 22:43:59 -08:00
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
|
|
|
|
|
2014-01-12 21:26:36 -08:00
|
|
|
if (ee->prop.focus_skip == on) return;
|
2012-02-27 22:43:59 -08:00
|
|
|
|
2014-01-12 21:26:36 -08:00
|
|
|
ee->prop.focus_skip = on;
|
2012-02-27 22:43:59 -08:00
|
|
|
if (ee->should_be_visible)
|
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
ecore_x_netwm_state_request_send(ee->prop.window, edata->win_root,
|
2014-01-12 21:26:36 -08:00
|
|
|
ECORE_X_WINDOW_STATE_SKIP_TASKBAR, -1,
|
|
|
|
on);
|
2012-12-05 13:15:42 -08:00
|
|
|
ecore_x_netwm_state_request_send(ee->prop.window, edata->win_root,
|
2014-01-12 21:26:36 -08:00
|
|
|
ECORE_X_WINDOW_STATE_SKIP_PAGER, -1,
|
|
|
|
on);
|
2012-02-27 22:43:59 -08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
_ecore_evas_x_state_update(ee);
|
|
|
|
_ecore_evas_x_hints_update(ee);
|
|
|
|
}
|
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
static void
|
2005-06-10 23:05:51 -07:00
|
|
|
_ecore_evas_x_show(Ecore_Evas *ee)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
2005-07-06 20:31:34 -07:00
|
|
|
ee->should_be_visible = 1;
|
2005-07-06 20:37:57 -07:00
|
|
|
if (ee->prop.avoid_damage)
|
2005-07-06 20:31:34 -07:00
|
|
|
_ecore_evas_x_render(ee);
|
2010-10-10 23:28:01 -07:00
|
|
|
_ecore_evas_x_sync_set(ee);
|
2012-12-04 22:48:46 -08:00
|
|
|
_ecore_evas_x_window_profile_set(ee);
|
2009-03-16 09:24:43 -07:00
|
|
|
ecore_x_window_show(ee->prop.window);
|
2003-09-23 01:09:32 -07:00
|
|
|
if (ee->prop.fullscreen)
|
2009-03-16 09:24:43 -07:00
|
|
|
ecore_x_window_focus(ee->prop.window);
|
2003-09-23 01:09:32 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-06-10 23:05:51 -07:00
|
|
|
_ecore_evas_x_hide(Ecore_Evas *ee)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
2009-03-16 09:24:43 -07:00
|
|
|
ecore_x_window_hide(ee->prop.window);
|
2003-09-23 01:09:32 -07:00
|
|
|
ee->should_be_visible = 0;
|
2010-10-10 23:28:01 -07:00
|
|
|
_ecore_evas_x_sync_set(ee);
|
2003-09-23 01:09:32 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-06-10 23:05:51 -07:00
|
|
|
_ecore_evas_x_raise(Ecore_Evas *ee)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
2011-07-26 04:24:10 -07:00
|
|
|
ecore_x_window_raise(ee->prop.window);
|
2003-09-23 01:09:32 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-06-10 23:05:51 -07:00
|
|
|
_ecore_evas_x_lower(Ecore_Evas *ee)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
2011-07-26 04:24:10 -07:00
|
|
|
ecore_x_window_lower(ee->prop.window);
|
2003-09-23 01:09:32 -07:00
|
|
|
}
|
|
|
|
|
2008-06-30 01:39:36 -07:00
|
|
|
static void
|
|
|
|
_ecore_evas_x_activate(Ecore_Evas *ee)
|
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
|
|
|
|
|
2013-01-10 03:23:10 -08:00
|
|
|
ecore_evas_show(ee);
|
2012-12-05 13:15:42 -08:00
|
|
|
ecore_x_netwm_client_active_request(edata->win_root,
|
2010-09-29 10:03:38 -07:00
|
|
|
ee->prop.window, 2, 0);
|
2008-06-30 01:39:36 -07:00
|
|
|
}
|
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
static void
|
2005-06-10 23:05:51 -07:00
|
|
|
_ecore_evas_x_title_set(Ecore_Evas *ee, const char *t)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
2015-01-22 11:37:56 -08:00
|
|
|
if (eina_streq(ee->prop.title, t)) return;
|
2003-09-23 01:09:32 -07:00
|
|
|
if (ee->prop.title) free(ee->prop.title);
|
|
|
|
ee->prop.title = NULL;
|
2013-08-07 07:38:35 -07:00
|
|
|
if (!t) return;
|
|
|
|
ee->prop.title = strdup(t);
|
2009-03-16 09:24:43 -07:00
|
|
|
ecore_x_icccm_title_set(ee->prop.window, ee->prop.title);
|
|
|
|
ecore_x_netwm_name_set(ee->prop.window, ee->prop.title);
|
2003-09-23 01:09:32 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-06-10 23:05:51 -07:00
|
|
|
_ecore_evas_x_name_class_set(Ecore_Evas *ee, const char *n, const char *c)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
2015-01-14 22:30:27 -08:00
|
|
|
if (!eina_streq(n, ee->prop.name))
|
|
|
|
{
|
|
|
|
free(ee->prop.name);
|
|
|
|
ee->prop.name = NULL;
|
|
|
|
if (n) ee->prop.name = strdup(n);
|
|
|
|
}
|
|
|
|
if (!eina_streq(c, ee->prop.clas))
|
|
|
|
{
|
|
|
|
free(ee->prop.clas);
|
|
|
|
ee->prop.clas = NULL;
|
|
|
|
if (c) ee->prop.clas = strdup(c);
|
|
|
|
}
|
2009-03-16 09:24:43 -07:00
|
|
|
ecore_x_icccm_name_class_set(ee->prop.window, ee->prop.name, ee->prop.clas);
|
2003-09-23 01:09:32 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-06-10 23:05:51 -07:00
|
|
|
_ecore_evas_x_size_min_set(Ecore_Evas *ee, int w, int h)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
|
|
|
if (w < 0) w = 0;
|
|
|
|
if (h < 0) h = 0;
|
|
|
|
if ((ee->prop.min.w == w) && (ee->prop.min.h == h)) return;
|
|
|
|
ee->prop.min.w = w;
|
|
|
|
ee->prop.min.h = h;
|
2005-06-10 23:05:51 -07:00
|
|
|
_ecore_evas_x_size_pos_hints_update(ee);
|
2003-09-23 01:09:32 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-06-10 23:05:51 -07:00
|
|
|
_ecore_evas_x_size_max_set(Ecore_Evas *ee, int w, int h)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
|
|
|
if (w < 0) w = 0;
|
|
|
|
if (h < 0) h = 0;
|
|
|
|
if ((ee->prop.max.w == w) && (ee->prop.max.h == h)) return;
|
|
|
|
ee->prop.max.w = w;
|
|
|
|
ee->prop.max.h = h;
|
2005-06-10 23:05:51 -07:00
|
|
|
_ecore_evas_x_size_pos_hints_update(ee);
|
2003-09-23 01:09:32 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-06-10 23:05:51 -07:00
|
|
|
_ecore_evas_x_size_base_set(Ecore_Evas *ee, int w, int h)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
|
|
|
if (w < 0) w = 0;
|
|
|
|
if (h < 0) h = 0;
|
|
|
|
if ((ee->prop.base.w == w) && (ee->prop.base.h == h)) return;
|
|
|
|
ee->prop.base.w = w;
|
|
|
|
ee->prop.base.h = h;
|
2005-06-10 23:05:51 -07:00
|
|
|
_ecore_evas_x_size_pos_hints_update(ee);
|
2003-09-23 01:09:32 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-06-10 23:05:51 -07:00
|
|
|
_ecore_evas_x_size_step_set(Ecore_Evas *ee, int w, int h)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
|
|
|
if (w < 1) w = 1;
|
|
|
|
if (h < 1) h = 1;
|
|
|
|
if ((ee->prop.step.w == w) && (ee->prop.step.h == h)) return;
|
|
|
|
ee->prop.step.w = w;
|
|
|
|
ee->prop.step.h = h;
|
2005-06-10 23:05:51 -07:00
|
|
|
_ecore_evas_x_size_pos_hints_update(ee);
|
2003-09-23 01:09:32 -07:00
|
|
|
}
|
|
|
|
|
2009-02-05 02:45:52 -08:00
|
|
|
static void
|
2012-11-25 01:55:32 -08:00
|
|
|
_ecore_evas_object_cursor_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
2009-02-05 02:45:52 -08:00
|
|
|
{
|
|
|
|
Ecore_Evas *ee;
|
|
|
|
|
|
|
|
ee = data;
|
2011-07-26 04:24:10 -07:00
|
|
|
if (ee) ee->prop.cursor.object = NULL;
|
2009-02-05 02:45:52 -08:00
|
|
|
}
|
|
|
|
|
2015-02-06 14:54:08 -08:00
|
|
|
static void
|
|
|
|
_ecore_evas_x_object_cursor_unset(Ecore_Evas *ee)
|
|
|
|
{
|
|
|
|
evas_object_event_callback_del_full(ee->prop.cursor.object, EVAS_CALLBACK_DEL, _ecore_evas_object_cursor_del, ee);
|
|
|
|
}
|
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
static void
|
2007-09-26 07:40:02 -07:00
|
|
|
_ecore_evas_x_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
2014-04-17 12:16:12 -07:00
|
|
|
int x = 0, y = 0;
|
2014-04-02 04:29:03 -07:00
|
|
|
Evas_Object *old;
|
Here is ecore_x with XCB backend.
* The XCB backend is disabled by default during the
configuration. To enable it, add --enable-ecore-x-xcb. See the
messages that configure displays when it finishes.
* The way XCB is detected, and used in src/lib/ecore_x/Makefile.am
should be improved
* Any program that uses ecore_evas does not need to be modified.
Any program that uses ecore_x may need some changes. That is,
adding some functions (_prefetch and _fetch ones). No other
change is needed. See the documention of any _get functions, as
these are the ones that need those functions.
* There are some missing parts, especially everything that involves
the keyboard, as porting Xlib functions related to strings (utf8
stuff, XKeysymToString, etc...) is an horror. So keyboard events
are not working yet.
* I tried to write as much documentation as I could. But there is
certainly some missing doc here and there.
there are certainly other things that I have forgotten.
Improvements of that backend:
* the creation of an ecore_evas is faster. Especially when done over
an ssh connection (on my computer, 7-10s with Xlib, 1.5s with XCB,
over an ssh)
* A Window Manager should be more responsive. But it's not tomorrow
that e17 will use it :)
Have fun !
SVN revision: 29500
2007-04-13 10:15:19 -07:00
|
|
|
|
2013-05-20 17:38:19 -07:00
|
|
|
old = ee->prop.cursor.object;
|
2010-08-21 06:52:25 -07:00
|
|
|
if (!obj)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
2010-09-29 10:03:38 -07:00
|
|
|
ee->prop.cursor.object = NULL;
|
|
|
|
ee->prop.cursor.layer = 0;
|
|
|
|
ee->prop.cursor.hot.x = 0;
|
|
|
|
ee->prop.cursor.hot.y = 0;
|
|
|
|
ecore_x_window_cursor_show(ee->prop.window, 1);
|
2013-05-20 17:38:19 -07:00
|
|
|
goto end;
|
2003-09-23 01:09:32 -07:00
|
|
|
}
|
2007-09-26 07:40:02 -07:00
|
|
|
|
|
|
|
ee->prop.cursor.object = obj;
|
2003-09-23 01:09:32 -07:00
|
|
|
ee->prop.cursor.layer = layer;
|
|
|
|
ee->prop.cursor.hot.x = hot_x;
|
Here is ecore_x with XCB backend.
* The XCB backend is disabled by default during the
configuration. To enable it, add --enable-ecore-x-xcb. See the
messages that configure displays when it finishes.
* The way XCB is detected, and used in src/lib/ecore_x/Makefile.am
should be improved
* Any program that uses ecore_evas does not need to be modified.
Any program that uses ecore_x may need some changes. That is,
adding some functions (_prefetch and _fetch ones). No other
change is needed. See the documention of any _get functions, as
these are the ones that need those functions.
* There are some missing parts, especially everything that involves
the keyboard, as porting Xlib functions related to strings (utf8
stuff, XKeysymToString, etc...) is an horror. So keyboard events
are not working yet.
* I tried to write as much documentation as I could. But there is
certainly some missing doc here and there.
there are certainly other things that I have forgotten.
Improvements of that backend:
* the creation of an ecore_evas is faster. Especially when done over
an ssh connection (on my computer, 7-10s with Xlib, 1.5s with XCB,
over an ssh)
* A Window Manager should be more responsive. But it's not tomorrow
that e17 will use it :)
Have fun !
SVN revision: 29500
2007-04-13 10:15:19 -07:00
|
|
|
ee->prop.cursor.hot.y = hot_y;
|
2007-09-26 07:40:02 -07:00
|
|
|
|
2014-06-25 10:11:16 -07:00
|
|
|
evas_pointer_output_xy_get(ee->evas, &x, &y);
|
|
|
|
|
2014-04-02 04:29:03 -07:00
|
|
|
if (obj != old)
|
|
|
|
{
|
|
|
|
ecore_x_window_cursor_show(ee->prop.window, 0);
|
|
|
|
evas_object_layer_set(ee->prop.cursor.object, ee->prop.cursor.layer);
|
|
|
|
evas_object_pass_events_set(ee->prop.cursor.object, 1);
|
|
|
|
if (evas_pointer_inside_get(ee->evas))
|
|
|
|
evas_object_show(ee->prop.cursor.object);
|
|
|
|
evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL,
|
|
|
|
_ecore_evas_object_cursor_del, ee);
|
|
|
|
}
|
2014-06-25 10:20:13 -07:00
|
|
|
|
|
|
|
evas_object_move(ee->prop.cursor.object, x - ee->prop.cursor.hot.x,
|
2010-09-29 10:03:38 -07:00
|
|
|
y - ee->prop.cursor.hot.y);
|
2013-05-20 17:38:19 -07:00
|
|
|
|
|
|
|
end:
|
2014-04-02 04:29:03 -07:00
|
|
|
if ((old) && (obj != old))
|
|
|
|
{
|
|
|
|
evas_object_event_callback_del_full
|
|
|
|
(old, EVAS_CALLBACK_DEL, _ecore_evas_object_cursor_del, ee);
|
|
|
|
evas_object_del(old);
|
|
|
|
}
|
2003-09-23 01:09:32 -07:00
|
|
|
}
|
|
|
|
|
2005-06-09 21:18:24 -07:00
|
|
|
/*
|
|
|
|
* @param ee
|
|
|
|
* @param layer If < 3, @a ee will be put below all other windows.
|
|
|
|
* If > 5, @a ee will be "always-on-top"
|
|
|
|
* If = 4, @a ee will be put in the default layer.
|
|
|
|
* Acceptable values range from 1 to 255 (0 reserved for
|
|
|
|
* desktop windows)
|
|
|
|
*/
|
2003-09-23 01:09:32 -07:00
|
|
|
static void
|
2005-06-10 23:05:51 -07:00
|
|
|
_ecore_evas_x_layer_set(Ecore_Evas *ee, int layer)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
|
|
|
if (ee->prop.layer == layer) return;
|
2005-06-09 21:18:24 -07:00
|
|
|
|
|
|
|
/* FIXME: Should this logic be here? */
|
|
|
|
if (layer < 1)
|
|
|
|
layer = 1;
|
|
|
|
else if (layer > 255)
|
|
|
|
layer = 255;
|
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
ee->prop.layer = layer;
|
2005-06-10 23:05:51 -07:00
|
|
|
_ecore_evas_x_layer_update(ee);
|
2003-09-23 01:09:32 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2014-01-11 01:19:43 -08:00
|
|
|
_ecore_evas_x_focus_set(Ecore_Evas *ee, Eina_Bool on EINA_UNUSED)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
2009-03-16 09:24:43 -07:00
|
|
|
ecore_x_window_focus(ee->prop.window);
|
2003-09-23 01:09:32 -07:00
|
|
|
}
|
|
|
|
|
2004-04-11 10:37:39 -07:00
|
|
|
static void
|
2014-01-11 01:19:43 -08:00
|
|
|
_ecore_evas_x_iconified_set(Ecore_Evas *ee, Eina_Bool on)
|
2004-04-11 10:37:39 -07:00
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
|
|
|
|
|
2011-07-26 04:24:10 -07:00
|
|
|
if (ee->prop.iconified == on) return;
|
2014-11-28 08:10:39 -08:00
|
|
|
if (((ee->should_be_visible) && (!ee->visible)) || (ee->visible))
|
2013-01-14 01:45:05 -08:00
|
|
|
ee->prop.iconified = on;
|
2012-02-27 22:43:59 -08:00
|
|
|
_ecore_evas_x_hints_update(ee);
|
2005-06-09 21:18:24 -07:00
|
|
|
if (on)
|
2012-12-05 13:15:42 -08:00
|
|
|
ecore_x_icccm_iconic_request_send(ee->prop.window, edata->win_root);
|
2005-06-09 21:18:24 -07:00
|
|
|
else
|
2013-10-14 18:45:37 -07:00
|
|
|
ecore_evas_show(ee);
|
2004-04-11 10:37:39 -07:00
|
|
|
}
|
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
static void
|
2014-01-12 21:26:36 -08:00
|
|
|
_ecore_evas_x_borderless_set(Ecore_Evas *ee, Eina_Bool on)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
2011-07-26 04:24:10 -07:00
|
|
|
if (ee->prop.borderless == on) return;
|
2003-09-23 01:09:32 -07:00
|
|
|
ee->prop.borderless = on;
|
2009-03-16 09:24:43 -07:00
|
|
|
ecore_x_mwm_borderless_set(ee->prop.window, ee->prop.borderless);
|
2003-09-23 01:09:32 -07:00
|
|
|
}
|
|
|
|
|
2005-06-09 21:18:24 -07:00
|
|
|
/* FIXME: This function changes the initial state of the ee
|
|
|
|
* whilest the iconic function changes the current state! */
|
2003-09-23 01:09:32 -07:00
|
|
|
static void
|
2014-01-12 21:26:36 -08:00
|
|
|
_ecore_evas_x_withdrawn_set(Ecore_Evas *ee, Eina_Bool on)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
2014-01-12 21:26:36 -08:00
|
|
|
if (ee->prop.withdrawn == on) return;
|
|
|
|
// ee->prop.withdrawn = on;
|
2012-02-27 22:43:59 -08:00
|
|
|
_ecore_evas_x_hints_update(ee);
|
2014-01-12 21:26:36 -08:00
|
|
|
if (on)
|
2013-01-10 03:23:10 -08:00
|
|
|
ecore_evas_hide(ee);
|
|
|
|
else
|
|
|
|
ecore_evas_show(ee);
|
2003-09-23 01:09:32 -07:00
|
|
|
}
|
|
|
|
|
2003-11-15 18:29:10 -08:00
|
|
|
static void
|
2014-01-12 21:26:36 -08:00
|
|
|
_ecore_evas_x_sticky_set(Ecore_Evas *ee, Eina_Bool on)
|
2003-11-15 18:29:10 -08:00
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
|
|
|
|
|
2014-01-12 21:26:36 -08:00
|
|
|
if (ee->prop.sticky == on) return;
|
2003-11-15 18:29:10 -08:00
|
|
|
|
2006-07-29 07:50:18 -07:00
|
|
|
/* We dont want to set prop.sticky here as it will cause
|
|
|
|
* the sticky callback not to get called. Its set on the
|
|
|
|
* property change event.
|
2014-01-12 21:26:36 -08:00
|
|
|
* ee->prop.sticky = on;
|
Here is ecore_x with XCB backend.
* The XCB backend is disabled by default during the
configuration. To enable it, add --enable-ecore-x-xcb. See the
messages that configure displays when it finishes.
* The way XCB is detected, and used in src/lib/ecore_x/Makefile.am
should be improved
* Any program that uses ecore_evas does not need to be modified.
Any program that uses ecore_x may need some changes. That is,
adding some functions (_prefetch and _fetch ones). No other
change is needed. See the documention of any _get functions, as
these are the ones that need those functions.
* There are some missing parts, especially everything that involves
the keyboard, as porting Xlib functions related to strings (utf8
stuff, XKeysymToString, etc...) is an horror. So keyboard events
are not working yet.
* I tried to write as much documentation as I could. But there is
certainly some missing doc here and there.
there are certainly other things that I have forgotten.
Improvements of that backend:
* the creation of an ecore_evas is faster. Especially when done over
an ssh connection (on my computer, 7-10s with Xlib, 1.5s with XCB,
over an ssh)
* A Window Manager should be more responsive. But it's not tomorrow
that e17 will use it :)
Have fun !
SVN revision: 29500
2007-04-13 10:15:19 -07:00
|
|
|
*/
|
2014-01-12 21:26:36 -08:00
|
|
|
// edata->state.sticky = on;
|
2005-06-09 21:18:24 -07:00
|
|
|
if (ee->should_be_visible)
|
2012-12-05 13:15:42 -08:00
|
|
|
ecore_x_netwm_state_request_send(ee->prop.window, edata->win_root,
|
2014-01-12 21:26:36 -08:00
|
|
|
ECORE_X_WINDOW_STATE_STICKY, -1, on);
|
2005-06-09 21:18:24 -07:00
|
|
|
else
|
2005-06-10 23:05:51 -07:00
|
|
|
_ecore_evas_x_state_update(ee);
|
2003-11-15 18:29:10 -08:00
|
|
|
}
|
|
|
|
|
2005-10-08 05:41:59 -07:00
|
|
|
static void
|
|
|
|
_ecore_evas_x_ignore_events_set(Ecore_Evas *ee, int ignore)
|
|
|
|
{
|
2011-07-26 04:24:10 -07:00
|
|
|
if (ee->ignore_events == ignore) return;
|
2005-10-08 05:41:59 -07:00
|
|
|
|
2011-07-26 04:24:10 -07:00
|
|
|
ee->ignore_events = ignore;
|
|
|
|
if (ee->prop.window)
|
|
|
|
ecore_x_window_ignore_set(ee->prop.window, ignore);
|
2005-10-08 05:41:59 -07:00
|
|
|
}
|
|
|
|
|
2006-03-08 19:51:43 -08:00
|
|
|
/*
|
2006-03-08 00:02:55 -08:00
|
|
|
static void
|
|
|
|
_ecore_evas_x_reinit_win(Ecore_Evas *ee)
|
|
|
|
{
|
|
|
|
if (!strcmp(ee->driver, "software_x11"))
|
|
|
|
{
|
2007-11-05 23:21:08 -08:00
|
|
|
#ifdef BUILD_ECORE_EVAS_X11
|
2010-09-29 10:03:38 -07:00
|
|
|
Evas_Engine_Info_Software_X11 *einfo;
|
|
|
|
|
|
|
|
einfo = (Evas_Engine_Info_Software_X11 *)evas_engine_info_get(ee->evas);
|
|
|
|
if (einfo)
|
|
|
|
{
|
|
|
|
einfo->info.drawable = ee->prop.window;
|
2014-09-30 09:19:15 -07:00
|
|
|
if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
|
|
|
|
{
|
|
|
|
ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
|
|
|
|
}
|
2010-09-29 10:03:38 -07:00
|
|
|
}
|
Here is ecore_x with XCB backend.
* The XCB backend is disabled by default during the
configuration. To enable it, add --enable-ecore-x-xcb. See the
messages that configure displays when it finishes.
* The way XCB is detected, and used in src/lib/ecore_x/Makefile.am
should be improved
* Any program that uses ecore_evas does not need to be modified.
Any program that uses ecore_x may need some changes. That is,
adding some functions (_prefetch and _fetch ones). No other
change is needed. See the documention of any _get functions, as
these are the ones that need those functions.
* There are some missing parts, especially everything that involves
the keyboard, as porting Xlib functions related to strings (utf8
stuff, XKeysymToString, etc...) is an horror. So keyboard events
are not working yet.
* I tried to write as much documentation as I could. But there is
certainly some missing doc here and there.
there are certainly other things that I have forgotten.
Improvements of that backend:
* the creation of an ecore_evas is faster. Especially when done over
an ssh connection (on my computer, 7-10s with Xlib, 1.5s with XCB,
over an ssh)
* A Window Manager should be more responsive. But it's not tomorrow
that e17 will use it :)
Have fun !
SVN revision: 29500
2007-04-13 10:15:19 -07:00
|
|
|
#endif
|
2006-03-08 00:02:55 -08:00
|
|
|
}
|
2008-10-29 12:31:05 -07:00
|
|
|
else if (!strcmp(ee->driver, "opengl_x11"))
|
2006-03-08 00:02:55 -08:00
|
|
|
{
|
2008-07-23 03:00:01 -07:00
|
|
|
#ifdef BUILD_ECORE_EVAS_OPENGL_X11
|
2010-09-29 10:03:38 -07:00
|
|
|
Evas_Engine_Info_GL_X11 *einfo;
|
|
|
|
|
|
|
|
einfo = (Evas_Engine_Info_GL_X11 *)evas_engine_info_get(ee->evas);
|
|
|
|
if (einfo)
|
|
|
|
{
|
|
|
|
einfo->info.drawable = ee->prop.window;
|
2014-09-30 09:19:15 -07:00
|
|
|
if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
|
|
|
|
{
|
|
|
|
ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
|
|
|
|
}
|
2010-09-29 10:03:38 -07:00
|
|
|
}
|
Here is ecore_x with XCB backend.
* The XCB backend is disabled by default during the
configuration. To enable it, add --enable-ecore-x-xcb. See the
messages that configure displays when it finishes.
* The way XCB is detected, and used in src/lib/ecore_x/Makefile.am
should be improved
* Any program that uses ecore_evas does not need to be modified.
Any program that uses ecore_x may need some changes. That is,
adding some functions (_prefetch and _fetch ones). No other
change is needed. See the documention of any _get functions, as
these are the ones that need those functions.
* There are some missing parts, especially everything that involves
the keyboard, as porting Xlib functions related to strings (utf8
stuff, XKeysymToString, etc...) is an horror. So keyboard events
are not working yet.
* I tried to write as much documentation as I could. But there is
certainly some missing doc here and there.
there are certainly other things that I have forgotten.
Improvements of that backend:
* the creation of an ecore_evas is faster. Especially when done over
an ssh connection (on my computer, 7-10s with Xlib, 1.5s with XCB,
over an ssh)
* A Window Manager should be more responsive. But it's not tomorrow
that e17 will use it :)
Have fun !
SVN revision: 29500
2007-04-13 10:15:19 -07:00
|
|
|
#endif
|
2006-03-08 00:02:55 -08:00
|
|
|
}
|
|
|
|
}
|
2006-03-08 19:51:43 -08:00
|
|
|
*/
|
2006-03-08 00:02:55 -08:00
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
static void
|
2014-01-12 21:26:36 -08:00
|
|
|
_ecore_evas_x_override_set(Ecore_Evas *ee, Eina_Bool on)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
2011-07-26 04:24:10 -07:00
|
|
|
if (ee->prop.override == on) return;
|
2011-11-21 21:51:06 -08:00
|
|
|
if (ee->should_be_visible) ecore_x_window_hide(ee->prop.window);
|
2009-03-16 09:24:43 -07:00
|
|
|
ecore_x_window_override_set(ee->prop.window, on);
|
2011-11-21 21:51:06 -08:00
|
|
|
if (ee->should_be_visible) ecore_x_window_show(ee->prop.window);
|
2009-03-16 09:24:43 -07:00
|
|
|
if (ee->prop.focused) ecore_x_window_focus(ee->prop.window);
|
2003-09-23 01:09:32 -07:00
|
|
|
ee->prop.override = on;
|
|
|
|
}
|
|
|
|
|
2012-08-05 02:00:08 -07:00
|
|
|
static void
|
2014-01-12 21:26:36 -08:00
|
|
|
_ecore_evas_x_maximized_set(Ecore_Evas *ee, Eina_Bool on)
|
2012-08-05 02:00:08 -07:00
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
|
|
|
|
|
2012-08-05 02:00:08 -07:00
|
|
|
if (ee->prop.maximized == on) return;
|
2012-12-05 13:15:42 -08:00
|
|
|
edata->state.maximized_h = 1;
|
|
|
|
edata->state.maximized_v = 1;
|
2013-01-10 03:53:07 -08:00
|
|
|
// ee->prop.maximized = on;
|
2012-08-05 02:00:08 -07:00
|
|
|
if (ee->should_be_visible)
|
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
ecore_x_netwm_state_request_send(ee->prop.window, edata->win_root,
|
2012-08-05 02:00:08 -07:00
|
|
|
ECORE_X_WINDOW_STATE_MAXIMIZED_VERT, -1, on);
|
2012-12-05 13:15:42 -08:00
|
|
|
ecore_x_netwm_state_request_send(ee->prop.window, edata->win_root,
|
2012-08-05 02:00:08 -07:00
|
|
|
ECORE_X_WINDOW_STATE_MAXIMIZED_HORZ, -1, on);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
_ecore_evas_x_state_update(ee);
|
|
|
|
}
|
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
static void
|
2014-01-12 21:26:36 -08:00
|
|
|
_ecore_evas_x_fullscreen_set(Ecore_Evas *ee, Eina_Bool on)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
|
|
|
|
|
2011-07-26 04:24:10 -07:00
|
|
|
if (ee->prop.fullscreen == on) return;
|
2006-08-12 03:16:53 -07:00
|
|
|
|
|
|
|
/* FIXME: Detect if WM is EWMH compliant and handle properly if not,
|
|
|
|
* i.e. reposition, resize, and change borderless hint */
|
2012-12-05 13:15:42 -08:00
|
|
|
edata->state.fullscreen = on;
|
2006-03-08 00:02:55 -08:00
|
|
|
if (ee->should_be_visible)
|
2012-12-05 13:15:42 -08:00
|
|
|
ecore_x_netwm_state_request_send(ee->prop.window, edata->win_root,
|
2010-09-29 10:03:38 -07:00
|
|
|
ECORE_X_WINDOW_STATE_FULLSCREEN, -1, on);
|
2003-11-15 18:29:10 -08:00
|
|
|
else
|
2006-08-12 03:16:53 -07:00
|
|
|
_ecore_evas_x_state_update(ee);
|
2003-09-23 01:09:32 -07:00
|
|
|
}
|
|
|
|
|
2012-12-04 22:48:46 -08:00
|
|
|
static void
|
|
|
|
_ecore_evas_x_profile_set(Ecore_Evas *ee, const char *profile)
|
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
|
|
|
|
|
2012-12-04 22:48:46 -08:00
|
|
|
_ecore_evas_window_profile_free(ee);
|
|
|
|
ee->prop.profile.name = NULL;
|
|
|
|
|
|
|
|
if (profile)
|
|
|
|
ee->prop.profile.name = (char *)eina_stringshare_add(profile);
|
2012-12-05 13:15:42 -08:00
|
|
|
edata->profile.change = 1;
|
2012-12-04 22:48:46 -08:00
|
|
|
_ecore_evas_x_window_profile_set(ee);
|
|
|
|
}
|
|
|
|
|
2012-07-03 00:44:17 -07:00
|
|
|
static void
|
|
|
|
_ecore_evas_x_profiles_set(Ecore_Evas *ee, const char **plist, int n)
|
|
|
|
{
|
2012-12-04 22:48:46 -08:00
|
|
|
int i;
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
|
|
|
|
|
2012-12-04 22:48:46 -08:00
|
|
|
_ecore_evas_window_available_profiles_free(ee);
|
|
|
|
ee->prop.profile.available_list = NULL;
|
|
|
|
|
|
|
|
if ((plist) && (n >= 1))
|
|
|
|
{
|
|
|
|
ee->prop.profile.available_list = calloc(n, sizeof(char *));
|
|
|
|
if (ee->prop.profile.available_list)
|
|
|
|
{
|
|
|
|
for (i = 0; i < n; i++)
|
|
|
|
ee->prop.profile.available_list[i] = (char *)eina_stringshare_add(plist[i]);
|
|
|
|
ee->prop.profile.count = n;
|
|
|
|
}
|
|
|
|
}
|
2012-12-05 13:15:42 -08:00
|
|
|
edata->profile.available = 1;
|
2012-12-04 22:48:46 -08:00
|
|
|
_ecore_evas_x_window_profile_set(ee);
|
2012-07-03 00:44:17 -07:00
|
|
|
}
|
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
static void
|
2012-12-18 08:27:26 -08:00
|
|
|
_avoid_damage_do(Ecore_Evas *ee, int on)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
2012-12-18 08:27:26 -08:00
|
|
|
#ifdef BUILD_ECORE_EVAS_SOFTWARE_X11
|
|
|
|
Evas_Engine_Info_Software_X11 *einfo;
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
|
|
|
|
|
2012-12-18 08:27:26 -08:00
|
|
|
ee->prop.avoid_damage = on;
|
|
|
|
einfo = (Evas_Engine_Info_Software_X11 *)evas_engine_info_get(ee->evas);
|
|
|
|
if (einfo)
|
2007-06-21 15:49:36 -07:00
|
|
|
{
|
2012-12-18 08:27:26 -08:00
|
|
|
if (ee->prop.avoid_damage)
|
2010-09-29 10:03:38 -07:00
|
|
|
{
|
2012-12-18 08:27:26 -08:00
|
|
|
edata->pmap = ecore_x_pixmap_new(ee->prop.window, ee->w, ee->h, einfo->info.depth);
|
|
|
|
edata->gc = ecore_x_gc_new(edata->pmap, 0, NULL);
|
|
|
|
einfo->info.drawable = edata->pmap;
|
|
|
|
if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
|
2010-09-29 10:03:38 -07:00
|
|
|
{
|
2012-12-18 08:27:26 -08:00
|
|
|
ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
|
2010-09-29 10:03:38 -07:00
|
|
|
}
|
2014-01-18 05:26:10 -08:00
|
|
|
if (ECORE_EVAS_PORTRAIT(ee))
|
2012-12-18 08:27:26 -08:00
|
|
|
evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
|
2014-01-18 05:26:10 -08:00
|
|
|
else
|
|
|
|
evas_damage_rectangle_add(ee->evas, 0, 0, ee->h, ee->w);
|
2012-12-18 08:27:26 -08:00
|
|
|
if (ee->prop.avoid_damage == ECORE_EVAS_AVOID_DAMAGE_BUILT_IN)
|
2010-09-29 10:03:38 -07:00
|
|
|
{
|
2012-12-18 08:27:26 -08:00
|
|
|
edata->using_bg_pixmap = 1;
|
|
|
|
ecore_x_window_pixmap_set(ee->prop.window, edata->pmap);
|
|
|
|
ecore_x_window_area_expose(ee->prop.window, 0, 0, ee->w, ee->h);
|
|
|
|
}
|
|
|
|
if (edata->direct_resize)
|
|
|
|
{
|
|
|
|
/* Turn this off for now
|
|
|
|
edata->using_bg_pixmap = 1;
|
|
|
|
ecore_x_window_pixmap_set(ee->prop.window, edata->pmap);
|
|
|
|
*/
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (edata->pmap) ecore_x_pixmap_free(edata->pmap);
|
|
|
|
if (edata->gc) ecore_x_gc_free(edata->gc);
|
|
|
|
if (edata->using_bg_pixmap)
|
|
|
|
{
|
|
|
|
ecore_x_window_pixmap_set(ee->prop.window, 0);
|
|
|
|
edata->using_bg_pixmap = 0;
|
|
|
|
ecore_x_window_area_expose(ee->prop.window, 0, 0, ee->w, ee->h);
|
|
|
|
}
|
|
|
|
edata->pmap = 0;
|
|
|
|
edata->gc = 0;
|
|
|
|
einfo->info.drawable = ee->prop.window;
|
|
|
|
if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
|
|
|
|
{
|
|
|
|
ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
|
2010-09-29 10:03:38 -07:00
|
|
|
}
|
|
|
|
}
|
2012-12-18 08:27:26 -08:00
|
|
|
}
|
2009-07-14 14:18:27 -07:00
|
|
|
#endif /* BUILD_ECORE_EVAS_SOFTWARE_X11 */
|
2012-12-18 08:27:26 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_ecore_evas_x_avoid_damage_set(Ecore_Evas *ee, int on)
|
|
|
|
{
|
|
|
|
if (ee->prop.avoid_damage == on) return;
|
|
|
|
if (!strcmp(ee->driver, "opengl_x11")) return;
|
|
|
|
|
|
|
|
if (!strcmp(ee->driver, "software_x11"))
|
|
|
|
{
|
|
|
|
if (ee->in_async_render)
|
|
|
|
{
|
|
|
|
ee->delayed.avoid_damage = on;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
_avoid_damage_do(ee, on);
|
2007-06-21 15:49:36 -07:00
|
|
|
}
|
2003-09-23 01:09:32 -07:00
|
|
|
}
|
|
|
|
|
2011-05-27 12:31:11 -07:00
|
|
|
static void
|
2012-11-25 01:55:32 -08:00
|
|
|
_ecore_evas_x_screen_geometry_get(const Ecore_Evas *ee EINA_UNUSED, int *x, int *y, int *w, int *h)
|
2011-05-27 12:31:11 -07:00
|
|
|
{
|
2012-07-05 05:51:05 -07:00
|
|
|
int outnum = 0;
|
|
|
|
int px = 0, py = 0, pw = 0, ph = 0;
|
|
|
|
Ecore_X_Window root;
|
|
|
|
Ecore_X_Randr_Output *out = NULL;
|
|
|
|
Ecore_X_Randr_Crtc crtc;
|
2012-08-21 01:06:53 -07:00
|
|
|
unsigned int val[4] = { 0 };
|
|
|
|
|
|
|
|
if (ecore_x_window_prop_card32_get
|
|
|
|
(ee->prop.window, ecore_x_atom_get("E_ZONE_GEOMETRY"), val, 4) == 4)
|
|
|
|
{
|
2012-08-22 01:27:06 -07:00
|
|
|
if (x) *x = (int)val[0];
|
|
|
|
if (y) *y = (int)val[1];
|
|
|
|
if (w) *w = (int)val[2];
|
|
|
|
if (h) *h = (int)val[3];
|
2012-08-21 01:06:53 -07:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2012-07-05 05:51:05 -07:00
|
|
|
root = ecore_x_window_root_get(ee->prop.window);
|
|
|
|
out = ecore_x_randr_window_outputs_get(ee->prop.window, &outnum);
|
|
|
|
if (!out)
|
|
|
|
{
|
|
|
|
norandr:
|
|
|
|
if (out) free(out);
|
|
|
|
if (x) *x = 0;
|
|
|
|
if (y) *y = 0;
|
|
|
|
ecore_x_window_size_get(root, w, h);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
crtc = ecore_x_randr_output_crtc_get(root, out[0]);
|
|
|
|
if (!crtc) goto norandr;
|
|
|
|
ecore_x_randr_crtc_geometry_get(root, crtc, &px, &py, &pw, &ph);
|
|
|
|
if ((pw == 0) || (ph == 0)) goto norandr;
|
|
|
|
if (x) *x = px;
|
|
|
|
if (y) *y = py;
|
|
|
|
if (w) *w = pw;
|
|
|
|
if (h) *h = ph;
|
|
|
|
free(out);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_ecore_evas_x_screen_dpi_get(const Ecore_Evas *ee, int *xdpi, int *ydpi)
|
|
|
|
{
|
|
|
|
int scdpi, xmm = 0, ymm = 0, outnum = 0, w = 0, h = 0;
|
|
|
|
int px = 0, py = 0;
|
|
|
|
Ecore_X_Window root;
|
|
|
|
Ecore_X_Randr_Output *out = NULL;
|
|
|
|
Ecore_X_Randr_Crtc crtc;
|
|
|
|
|
|
|
|
root = ecore_x_window_root_get(ee->prop.window);
|
|
|
|
out = ecore_x_randr_window_outputs_get(ee->prop.window, &outnum);
|
|
|
|
if (!out)
|
|
|
|
{
|
|
|
|
norandr:
|
|
|
|
if (out) free(out);
|
|
|
|
scdpi = ecore_x_dpi_get();
|
|
|
|
if (xdpi) *xdpi = scdpi;
|
|
|
|
if (ydpi) *ydpi = scdpi;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
crtc = ecore_x_randr_output_crtc_get(root, out[0]);
|
|
|
|
if (!crtc) goto norandr;
|
|
|
|
ecore_x_randr_crtc_geometry_get(root, crtc, &px, &py, &w, &h);
|
|
|
|
if ((w == 0) || (h == 0)) goto norandr;
|
|
|
|
ecore_x_randr_output_size_mm_get(root, out[0], &xmm, &ymm);
|
|
|
|
if ((xmm == 0) || (ymm == 0)) goto norandr;
|
|
|
|
if (xdpi) *xdpi = (w * 254) / (xmm * 10); // 25.4mm / inch
|
|
|
|
if (ydpi) *ydpi = (h * 254) / (ymm * 10); // 25.4mm / inch
|
|
|
|
free(out);
|
2011-05-27 12:31:11 -07:00
|
|
|
}
|
|
|
|
|
2013-07-08 02:57:00 -07:00
|
|
|
static void
|
|
|
|
_ecore_evas_x_pointer_xy_get(const Ecore_Evas *ee, Evas_Coord *x, Evas_Coord *y)
|
|
|
|
{
|
|
|
|
if (ee->prop.window)
|
|
|
|
ecore_x_pointer_xy_get(ee->prop.window, x, y);
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_ecore_evas_x_pointer_warp(const Ecore_Evas *ee, Evas_Coord x, Evas_Coord y)
|
|
|
|
{
|
|
|
|
return ecore_x_pointer_warp(ee->prop.window, x, y);
|
|
|
|
}
|
|
|
|
|
2014-02-08 16:46:51 -08:00
|
|
|
static void
|
|
|
|
_ecore_evas_x_wm_rot_preferred_rotation_set(Ecore_Evas *ee, int rot)
|
|
|
|
{
|
|
|
|
if (ee->prop.wm_rot.supported)
|
|
|
|
{
|
|
|
|
if (!ee->prop.wm_rot.app_set)
|
|
|
|
{
|
|
|
|
ecore_x_e_window_rotation_app_set(ee->prop.window, EINA_TRUE);
|
|
|
|
ee->prop.wm_rot.app_set = EINA_TRUE;
|
|
|
|
}
|
|
|
|
ecore_x_e_window_rotation_preferred_rotation_set(ee->prop.window, rot);
|
|
|
|
ee->prop.wm_rot.preferred_rot = rot;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_ecore_evas_x_wm_rot_available_rotations_set(Ecore_Evas *ee, const int *rots, unsigned int count)
|
|
|
|
{
|
|
|
|
if (ee->prop.wm_rot.supported)
|
|
|
|
{
|
|
|
|
if (!ee->prop.wm_rot.app_set)
|
|
|
|
{
|
|
|
|
ecore_x_e_window_rotation_app_set(ee->prop.window, EINA_TRUE);
|
|
|
|
ee->prop.wm_rot.app_set = EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ee->prop.wm_rot.available_rots)
|
|
|
|
{
|
|
|
|
free(ee->prop.wm_rot.available_rots);
|
|
|
|
ee->prop.wm_rot.available_rots = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
ee->prop.wm_rot.count = 0;
|
|
|
|
|
|
|
|
if (count > 0)
|
|
|
|
{
|
|
|
|
ee->prop.wm_rot.available_rots = calloc(count, sizeof(int));
|
|
|
|
if (!ee->prop.wm_rot.available_rots) return;
|
|
|
|
|
|
|
|
memcpy(ee->prop.wm_rot.available_rots, rots, sizeof(int) * count);
|
|
|
|
}
|
|
|
|
|
|
|
|
ee->prop.wm_rot.count = count;
|
|
|
|
|
|
|
|
ecore_x_e_window_rotation_available_rotations_set(ee->prop.window, rots, count);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_ecore_evas_x_wm_rot_manual_rotation_done_set(Ecore_Evas *ee, Eina_Bool set)
|
|
|
|
{
|
|
|
|
ee->prop.wm_rot.manual_mode.set = set;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_ecore_evas_x_wm_rot_manual_rotation_done(Ecore_Evas *ee)
|
|
|
|
{
|
|
|
|
Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
|
|
|
|
|
|
|
|
if ((ee->prop.wm_rot.supported) &&
|
|
|
|
(ee->prop.wm_rot.app_set) &&
|
|
|
|
(ee->prop.wm_rot.manual_mode.set))
|
|
|
|
{
|
|
|
|
if (ee->prop.wm_rot.manual_mode.wait_for_done)
|
|
|
|
{
|
|
|
|
if (ee->prop.wm_rot.manual_mode.timer)
|
|
|
|
ecore_timer_del(ee->prop.wm_rot.manual_mode.timer);
|
|
|
|
ee->prop.wm_rot.manual_mode.timer = NULL;
|
|
|
|
|
|
|
|
if (edata->wm_rot.manual_mode_job)
|
|
|
|
ecore_job_del(edata->wm_rot.manual_mode_job);
|
|
|
|
edata->wm_rot.manual_mode_job = ecore_job_add
|
|
|
|
(_ecore_evas_x_wm_rot_manual_rotation_done_job, ee);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_ecore_evas_x_wm_rot_manual_rotation_done_timeout(void *data)
|
|
|
|
{
|
|
|
|
Ecore_Evas *ee = data;
|
|
|
|
|
|
|
|
ee->prop.wm_rot.manual_mode.timer = NULL;
|
|
|
|
_ecore_evas_x_wm_rot_manual_rotation_done(ee);
|
|
|
|
return ECORE_CALLBACK_CANCEL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_ecore_evas_x_wm_rot_manual_rotation_done_timeout_update(Ecore_Evas *ee)
|
|
|
|
{
|
|
|
|
if (ee->prop.wm_rot.manual_mode.timer)
|
|
|
|
ecore_timer_del(ee->prop.wm_rot.manual_mode.timer);
|
|
|
|
|
|
|
|
ee->prop.wm_rot.manual_mode.timer = ecore_timer_add
|
|
|
|
(4.0f, _ecore_evas_x_wm_rot_manual_rotation_done_timeout, ee);
|
|
|
|
}
|
|
|
|
|
2014-02-27 14:20:01 -08:00
|
|
|
static void
|
|
|
|
_ecore_evas_x_aux_hints_set(Ecore_Evas *ee, const char *hints)
|
|
|
|
{
|
|
|
|
if (hints)
|
|
|
|
ecore_x_window_prop_property_set
|
|
|
|
(ee->prop.window, ECORE_X_ATOM_E_WINDOW_AUX_HINT,
|
|
|
|
ECORE_X_ATOM_STRING, 8, (void *)hints, strlen(hints) + 1);
|
|
|
|
else
|
|
|
|
ecore_x_window_prop_property_del
|
|
|
|
(ee->prop.window, ECORE_X_ATOM_E_WINDOW_AUX_HINT);
|
|
|
|
}
|
|
|
|
|
2010-01-06 21:29:06 -08:00
|
|
|
static Ecore_Evas_Engine_Func _ecore_x_engine_func =
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
|
|
|
_ecore_evas_x_free,
|
2013-07-08 02:16:09 -07:00
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
_ecore_evas_x_callback_delete_request_set,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
_ecore_evas_x_move,
|
|
|
|
_ecore_evas_x_managed_move,
|
|
|
|
_ecore_evas_x_resize,
|
|
|
|
_ecore_evas_x_move_resize,
|
|
|
|
_ecore_evas_x_rotation_set,
|
|
|
|
_ecore_evas_x_shaped_set,
|
|
|
|
_ecore_evas_x_show,
|
|
|
|
_ecore_evas_x_hide,
|
|
|
|
_ecore_evas_x_raise,
|
|
|
|
_ecore_evas_x_lower,
|
|
|
|
_ecore_evas_x_activate,
|
|
|
|
_ecore_evas_x_title_set,
|
|
|
|
_ecore_evas_x_name_class_set,
|
|
|
|
_ecore_evas_x_size_min_set,
|
|
|
|
_ecore_evas_x_size_max_set,
|
|
|
|
_ecore_evas_x_size_base_set,
|
|
|
|
_ecore_evas_x_size_step_set,
|
|
|
|
_ecore_evas_x_object_cursor_set,
|
2015-02-06 14:54:08 -08:00
|
|
|
_ecore_evas_x_object_cursor_unset,
|
2013-07-08 02:16:09 -07:00
|
|
|
_ecore_evas_x_layer_set,
|
|
|
|
_ecore_evas_x_focus_set,
|
|
|
|
_ecore_evas_x_iconified_set,
|
|
|
|
_ecore_evas_x_borderless_set,
|
|
|
|
_ecore_evas_x_override_set,
|
|
|
|
_ecore_evas_x_maximized_set,
|
|
|
|
_ecore_evas_x_fullscreen_set,
|
|
|
|
_ecore_evas_x_avoid_damage_set,
|
|
|
|
_ecore_evas_x_withdrawn_set,
|
|
|
|
_ecore_evas_x_sticky_set,
|
|
|
|
_ecore_evas_x_ignore_events_set,
|
|
|
|
_ecore_evas_x_alpha_set,
|
|
|
|
_ecore_evas_x_transparent_set,
|
|
|
|
_ecore_evas_x_profiles_set,
|
|
|
|
_ecore_evas_x_profile_set,
|
|
|
|
|
|
|
|
_ecore_evas_x_window_group_set,
|
|
|
|
_ecore_evas_x_aspect_set,
|
|
|
|
_ecore_evas_x_urgent_set,
|
|
|
|
_ecore_evas_x_modal_set,
|
|
|
|
_ecore_evas_x_demand_attention_set,
|
|
|
|
_ecore_evas_x_focus_skip_set,
|
|
|
|
|
|
|
|
NULL, // render
|
|
|
|
_ecore_evas_x_screen_geometry_get,
|
|
|
|
_ecore_evas_x_screen_dpi_get,
|
|
|
|
NULL,
|
2013-07-08 02:57:00 -07:00
|
|
|
NULL, //fn_msg_send
|
|
|
|
|
|
|
|
_ecore_evas_x_pointer_xy_get,
|
2014-02-08 16:46:51 -08:00
|
|
|
_ecore_evas_x_pointer_warp,
|
|
|
|
|
|
|
|
_ecore_evas_x_wm_rot_preferred_rotation_set,
|
|
|
|
_ecore_evas_x_wm_rot_available_rotations_set,
|
|
|
|
_ecore_evas_x_wm_rot_manual_rotation_done_set,
|
2014-02-27 14:20:01 -08:00
|
|
|
_ecore_evas_x_wm_rot_manual_rotation_done,
|
|
|
|
|
|
|
|
_ecore_evas_x_aux_hints_set
|
2003-09-23 01:09:32 -07:00
|
|
|
};
|
|
|
|
|
Here is ecore_x with XCB backend.
* The XCB backend is disabled by default during the
configuration. To enable it, add --enable-ecore-x-xcb. See the
messages that configure displays when it finishes.
* The way XCB is detected, and used in src/lib/ecore_x/Makefile.am
should be improved
* Any program that uses ecore_evas does not need to be modified.
Any program that uses ecore_x may need some changes. That is,
adding some functions (_prefetch and _fetch ones). No other
change is needed. See the documention of any _get functions, as
these are the ones that need those functions.
* There are some missing parts, especially everything that involves
the keyboard, as porting Xlib functions related to strings (utf8
stuff, XKeysymToString, etc...) is an horror. So keyboard events
are not working yet.
* I tried to write as much documentation as I could. But there is
certainly some missing doc here and there.
there are certainly other things that I have forgotten.
Improvements of that backend:
* the creation of an ecore_evas is faster. Especially when done over
an ssh connection (on my computer, 7-10s with Xlib, 1.5s with XCB,
over an ssh)
* A Window Manager should be more responsive. But it's not tomorrow
that e17 will use it :)
Have fun !
SVN revision: 29500
2007-04-13 10:15:19 -07:00
|
|
|
/*
|
|
|
|
* FIXME: there are some round trips. Especially, we can split
|
2010-09-08 04:23:42 -07:00
|
|
|
* ecore_x_init in 2 functions and suppress some round trips.
|
Here is ecore_x with XCB backend.
* The XCB backend is disabled by default during the
configuration. To enable it, add --enable-ecore-x-xcb. See the
messages that configure displays when it finishes.
* The way XCB is detected, and used in src/lib/ecore_x/Makefile.am
should be improved
* Any program that uses ecore_evas does not need to be modified.
Any program that uses ecore_x may need some changes. That is,
adding some functions (_prefetch and _fetch ones). No other
change is needed. See the documention of any _get functions, as
these are the ones that need those functions.
* There are some missing parts, especially everything that involves
the keyboard, as porting Xlib functions related to strings (utf8
stuff, XKeysymToString, etc...) is an horror. So keyboard events
are not working yet.
* I tried to write as much documentation as I could. But there is
certainly some missing doc here and there.
there are certainly other things that I have forgotten.
Improvements of that backend:
* the creation of an ecore_evas is faster. Especially when done over
an ssh connection (on my computer, 7-10s with Xlib, 1.5s with XCB,
over an ssh)
* A Window Manager should be more responsive. But it's not tomorrow
that e17 will use it :)
Have fun !
SVN revision: 29500
2007-04-13 10:15:19 -07:00
|
|
|
*/
|
|
|
|
|
2012-10-15 19:54:05 -07:00
|
|
|
#if defined (BUILD_ECORE_EVAS_SOFTWARE_X11) || defined (BUILD_ECORE_EVAS_OPENGL_X11)
|
2013-07-05 02:38:43 -07:00
|
|
|
static void
|
|
|
|
_ecore_evas_x_render_pre(void *data, Evas *e EINA_UNUSED, void *event_info EINA_UNUSED)
|
|
|
|
{
|
|
|
|
Ecore_Evas *ee = data;
|
|
|
|
Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
|
|
|
|
|
|
|
|
/* printf("Ecore_Evas Render Pre\n"); */
|
|
|
|
/* printf("\tPixman Size: %d %d\n", edata->pixmap.w, edata->pixmap.h); */
|
|
|
|
/* printf("\tEE Size: %d %d\n", ee->w, ee->h); */
|
|
|
|
|
|
|
|
/* before rendering to the back buffer pixmap, we should check the
|
|
|
|
* size. If the back buffer is not the proper size, destroy it and
|
|
|
|
* create a new one at the proper size */
|
|
|
|
if ((edata->pixmap.w != ee->w) || (edata->pixmap.h != ee->h))
|
|
|
|
{
|
|
|
|
/* free the backing pixmap */
|
|
|
|
if (edata->pixmap.back)
|
|
|
|
ecore_x_pixmap_free(edata->pixmap.back);
|
|
|
|
|
|
|
|
edata->pixmap.back =
|
|
|
|
ecore_x_pixmap_new(edata->win_root, ee->w, ee->h,
|
|
|
|
edata->pixmap.depth);
|
|
|
|
|
|
|
|
edata->pixmap.w = ee->w;
|
|
|
|
edata->pixmap.h = ee->h;
|
|
|
|
|
|
|
|
if (!strcmp(ee->driver, "software_x11"))
|
|
|
|
{
|
|
|
|
# ifdef BUILD_ECORE_EVAS_SOFTWARE_X11
|
|
|
|
Evas_Engine_Info_Software_X11 *einfo;
|
|
|
|
|
|
|
|
einfo = (Evas_Engine_Info_Software_X11 *)evas_engine_info_get(ee->evas);
|
|
|
|
if (einfo)
|
|
|
|
{
|
|
|
|
einfo->info.drawable = edata->pixmap.back;
|
|
|
|
|
|
|
|
if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
|
|
|
|
{
|
|
|
|
ERR("evas_engine_info_set() init engine '%s' failed.",
|
|
|
|
ee->driver);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
# endif
|
|
|
|
}
|
|
|
|
else if (!strcmp(ee->driver, "opengl_x11"))
|
|
|
|
{
|
|
|
|
# ifdef BUILD_ECORE_EVAS_OPENGL_X11
|
|
|
|
Evas_Engine_Info_GL_X11 *einfo;
|
|
|
|
|
|
|
|
einfo = (Evas_Engine_Info_GL_X11 *)evas_engine_info_get(ee->evas);
|
|
|
|
if (einfo)
|
|
|
|
{
|
|
|
|
einfo->info.drawable = edata->pixmap.back;
|
|
|
|
|
|
|
|
if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
|
|
|
|
{
|
|
|
|
ERR("evas_engine_info_set() init engine '%s' failed.",
|
|
|
|
ee->driver);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
# endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-02-01 06:13:48 -08:00
|
|
|
static void
|
2012-11-25 01:55:32 -08:00
|
|
|
_ecore_evas_x_flush_pre(void *data, Evas *e EINA_UNUSED, void *event_info EINA_UNUSED)
|
2010-02-01 06:13:48 -08:00
|
|
|
{
|
|
|
|
Ecore_Evas *ee = data;
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
|
2010-02-01 06:13:48 -08:00
|
|
|
|
|
|
|
if (ee->no_comp_sync) return;
|
|
|
|
if (!_ecore_evas_app_comp_sync) return;
|
2014-01-08 06:29:40 -08:00
|
|
|
if (!edata->sync_counter) return;
|
|
|
|
if (!edata->sync_began) return;
|
|
|
|
|
|
|
|
edata->sync_val++;
|
|
|
|
if (!edata->sync_cancel)
|
2010-02-01 06:13:48 -08:00
|
|
|
{
|
2014-01-08 06:29:40 -08:00
|
|
|
if (!ee->semi_sync)
|
|
|
|
ecore_x_sync_counter_val_wait(edata->sync_counter,
|
|
|
|
edata->sync_val);
|
2010-02-01 06:13:48 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-11-25 01:55:32 -08:00
|
|
|
_ecore_evas_x_flush_post(void *data, Evas *e EINA_UNUSED, void *event_info EINA_UNUSED)
|
2010-02-01 06:13:48 -08:00
|
|
|
{
|
|
|
|
Ecore_Evas *ee = data;
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
|
2010-08-24 02:26:34 -07:00
|
|
|
|
2013-07-05 02:38:43 -07:00
|
|
|
if ((!ee->prop.window) && (edata->pixmap.back))
|
|
|
|
{
|
2013-07-11 00:50:25 -07:00
|
|
|
Ecore_X_Pixmap prev;
|
|
|
|
|
2013-07-05 02:38:43 -07:00
|
|
|
/* printf("Ecore_Evas Flush Post\n"); */
|
|
|
|
/* printf("\tBack Pixmap: %d\n", edata->pixmap.back); */
|
|
|
|
/* printf("\tFront Pixmap: %d\n", edata->pixmap.front); */
|
|
|
|
|
|
|
|
/* done drawing to the back buffer. flip it to the front so that
|
|
|
|
* any calls to "fetch pixmap" will return the front buffer already
|
|
|
|
* pre-rendered */
|
|
|
|
|
|
|
|
/* record the current front buffer */
|
2013-07-11 00:50:25 -07:00
|
|
|
prev = edata->pixmap.front;
|
2013-07-05 02:38:43 -07:00
|
|
|
|
|
|
|
/* flip them */
|
|
|
|
edata->pixmap.front = edata->pixmap.back;
|
|
|
|
|
|
|
|
/* reassign back buffer to be the old front one */
|
2013-07-11 00:50:25 -07:00
|
|
|
edata->pixmap.back = prev;
|
2013-07-05 02:38:43 -07:00
|
|
|
|
|
|
|
/* update evas drawable */
|
|
|
|
if (!strcmp(ee->driver, "software_x11"))
|
|
|
|
{
|
|
|
|
# ifdef BUILD_ECORE_EVAS_SOFTWARE_X11
|
|
|
|
Evas_Engine_Info_Software_X11 *einfo;
|
|
|
|
|
|
|
|
einfo = (Evas_Engine_Info_Software_X11 *)evas_engine_info_get(ee->evas);
|
|
|
|
if (einfo)
|
|
|
|
{
|
|
|
|
einfo->info.drawable = edata->pixmap.back;
|
|
|
|
|
|
|
|
if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
|
|
|
|
{
|
|
|
|
ERR("evas_engine_info_set() init engine '%s' failed.",
|
|
|
|
ee->driver);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
# endif
|
|
|
|
}
|
|
|
|
else if (!strcmp(ee->driver, "opengl_x11"))
|
|
|
|
{
|
|
|
|
# ifdef BUILD_ECORE_EVAS_OPENGL_X11
|
|
|
|
Evas_Engine_Info_GL_X11 *einfo;
|
|
|
|
|
|
|
|
einfo = (Evas_Engine_Info_GL_X11 *)evas_engine_info_get(ee->evas);
|
|
|
|
if (einfo)
|
|
|
|
{
|
|
|
|
einfo->info.drawable = edata->pixmap.back;
|
|
|
|
|
|
|
|
if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
|
|
|
|
{
|
|
|
|
ERR("evas_engine_info_set() init engine '%s' failed.",
|
|
|
|
ee->driver);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
# endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-07-03 00:44:17 -07:00
|
|
|
if ((!ee->no_comp_sync) && (_ecore_evas_app_comp_sync) &&
|
2014-01-08 06:24:50 -08:00
|
|
|
(ee->gl_sync_draw_done != 1))
|
2011-03-31 01:13:14 -07:00
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
if (edata->sync_counter)
|
2011-03-31 01:13:14 -07:00
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
if (edata->sync_began)
|
2011-03-31 01:13:14 -07:00
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
if (!edata->sync_cancel)
|
2011-03-31 01:13:14 -07:00
|
|
|
{
|
2013-07-05 02:38:43 -07:00
|
|
|
if (ee->prop.window)
|
|
|
|
{
|
|
|
|
ecore_x_e_comp_sync_draw_size_done_send
|
|
|
|
(edata->win_root, ee->prop.window, ee->w, ee->h);
|
|
|
|
}
|
2011-03-31 01:13:14 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2012-12-05 13:15:42 -08:00
|
|
|
if (edata->netwm_sync_set)
|
2011-03-30 03:10:04 -07:00
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
ecore_x_sync_counter_2_set(edata->netwm_sync_counter,
|
|
|
|
edata->netwm_sync_val_hi,
|
|
|
|
edata->netwm_sync_val_lo);
|
|
|
|
edata->netwm_sync_set = 0;
|
2011-03-30 03:10:04 -07:00
|
|
|
}
|
2012-12-05 13:15:42 -08:00
|
|
|
if (edata->profile.done)
|
2012-12-04 22:48:46 -08:00
|
|
|
{
|
2013-07-05 02:38:43 -07:00
|
|
|
if (ee->prop.window)
|
|
|
|
{
|
|
|
|
ecore_x_e_window_profile_change_done_send
|
|
|
|
(edata->win_root, ee->prop.window, ee->prop.profile.name);
|
|
|
|
}
|
2012-12-05 13:15:42 -08:00
|
|
|
edata->profile.done = 0;
|
2012-12-04 22:48:46 -08:00
|
|
|
}
|
2014-02-08 16:46:51 -08:00
|
|
|
if ((ee->prop.wm_rot.supported) &&
|
|
|
|
(edata->wm_rot.done))
|
|
|
|
{
|
|
|
|
if (!ee->prop.wm_rot.manual_mode.set)
|
|
|
|
{
|
|
|
|
ecore_x_e_window_rotation_change_done_send
|
|
|
|
(edata->win_root, ee->prop.window, ee->rotation, ee->w, ee->h);
|
|
|
|
edata->wm_rot.done = 0;
|
|
|
|
}
|
|
|
|
}
|
2010-02-01 06:13:48 -08:00
|
|
|
}
|
2010-02-03 08:05:25 -08:00
|
|
|
#endif
|
2010-02-01 06:13:48 -08:00
|
|
|
|
2009-07-14 14:18:27 -07:00
|
|
|
#ifdef BUILD_ECORE_EVAS_SOFTWARE_X11
|
2006-01-06 10:46:30 -08:00
|
|
|
EAPI Ecore_Evas *
|
2012-12-05 13:15:42 -08:00
|
|
|
ecore_evas_software_x11_new_internal(const char *disp_name, Ecore_X_Window parent,
|
|
|
|
int x, int y, int w, int h)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
|
|
|
Evas_Engine_Info_Software_X11 *einfo;
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Interface_X11 *iface;
|
|
|
|
Ecore_Evas_Interface_Software_X11 *siface;
|
|
|
|
Ecore_Evas_Engine_Data_X11 *edata;
|
2003-09-23 01:09:32 -07:00
|
|
|
Ecore_Evas *ee;
|
2011-07-26 04:24:10 -07:00
|
|
|
int argb = 0, rmethod;
|
2005-11-01 01:49:12 -08:00
|
|
|
static int redraw_debug = -1;
|
2011-07-26 04:24:10 -07:00
|
|
|
char *id = NULL;
|
2003-09-23 01:09:32 -07:00
|
|
|
|
|
|
|
rmethod = evas_render_method_lookup("software_x11");
|
|
|
|
if (!rmethod) return NULL;
|
|
|
|
if (!ecore_x_init(disp_name)) return NULL;
|
|
|
|
ee = calloc(1, sizeof(Ecore_Evas));
|
|
|
|
if (!ee) return NULL;
|
2012-12-05 13:15:42 -08:00
|
|
|
edata = calloc(1, sizeof(Ecore_Evas_Engine_Data_X11));
|
|
|
|
if (!edata)
|
|
|
|
{
|
|
|
|
free(ee);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
ee->engine.data = edata;
|
|
|
|
iface = _ecore_evas_x_interface_x11_new();
|
|
|
|
siface = _ecore_evas_x_interface_software_x11_new();
|
|
|
|
|
|
|
|
ee->engine.ifaces = eina_list_append(ee->engine.ifaces, iface);
|
|
|
|
ee->engine.ifaces = eina_list_append(ee->engine.ifaces, siface);
|
Here is ecore_x with XCB backend.
* The XCB backend is disabled by default during the
configuration. To enable it, add --enable-ecore-x-xcb. See the
messages that configure displays when it finishes.
* The way XCB is detected, and used in src/lib/ecore_x/Makefile.am
should be improved
* Any program that uses ecore_evas does not need to be modified.
Any program that uses ecore_x may need some changes. That is,
adding some functions (_prefetch and _fetch ones). No other
change is needed. See the documention of any _get functions, as
these are the ones that need those functions.
* There are some missing parts, especially everything that involves
the keyboard, as porting Xlib functions related to strings (utf8
stuff, XKeysymToString, etc...) is an horror. So keyboard events
are not working yet.
* I tried to write as much documentation as I could. But there is
certainly some missing doc here and there.
there are certainly other things that I have forgotten.
Improvements of that backend:
* the creation of an ecore_evas is faster. Especially when done over
an ssh connection (on my computer, 7-10s with Xlib, 1.5s with XCB,
over an ssh)
* A Window Manager should be more responsive. But it's not tomorrow
that e17 will use it :)
Have fun !
SVN revision: 29500
2007-04-13 10:15:19 -07:00
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
ECORE_MAGIC_SET(ee, ECORE_MAGIC_EVAS);
|
Here is ecore_x with XCB backend.
* The XCB backend is disabled by default during the
configuration. To enable it, add --enable-ecore-x-xcb. See the
messages that configure displays when it finishes.
* The way XCB is detected, and used in src/lib/ecore_x/Makefile.am
should be improved
* Any program that uses ecore_evas does not need to be modified.
Any program that uses ecore_x may need some changes. That is,
adding some functions (_prefetch and _fetch ones). No other
change is needed. See the documention of any _get functions, as
these are the ones that need those functions.
* There are some missing parts, especially everything that involves
the keyboard, as porting Xlib functions related to strings (utf8
stuff, XKeysymToString, etc...) is an horror. So keyboard events
are not working yet.
* I tried to write as much documentation as I could. But there is
certainly some missing doc here and there.
there are certainly other things that I have forgotten.
Improvements of that backend:
* the creation of an ecore_evas is faster. Especially when done over
an ssh connection (on my computer, 7-10s with Xlib, 1.5s with XCB,
over an ssh)
* A Window Manager should be more responsive. But it's not tomorrow
that e17 will use it :)
Have fun !
SVN revision: 29500
2007-04-13 10:15:19 -07:00
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
_ecore_evas_x_init();
|
Here is ecore_x with XCB backend.
* The XCB backend is disabled by default during the
configuration. To enable it, add --enable-ecore-x-xcb. See the
messages that configure displays when it finishes.
* The way XCB is detected, and used in src/lib/ecore_x/Makefile.am
should be improved
* Any program that uses ecore_evas does not need to be modified.
Any program that uses ecore_x may need some changes. That is,
adding some functions (_prefetch and _fetch ones). No other
change is needed. See the documention of any _get functions, as
these are the ones that need those functions.
* There are some missing parts, especially everything that involves
the keyboard, as porting Xlib functions related to strings (utf8
stuff, XKeysymToString, etc...) is an horror. So keyboard events
are not working yet.
* I tried to write as much documentation as I could. But there is
certainly some missing doc here and there.
there are certainly other things that I have forgotten.
Improvements of that backend:
* the creation of an ecore_evas is faster. Especially when done over
an ssh connection (on my computer, 7-10s with Xlib, 1.5s with XCB,
over an ssh)
* A Window Manager should be more responsive. But it's not tomorrow
that e17 will use it :)
Have fun !
SVN revision: 29500
2007-04-13 10:15:19 -07:00
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
ee->engine.func = (Ecore_Evas_Engine_Func *)&_ecore_x_engine_func;
|
Here is ecore_x with XCB backend.
* The XCB backend is disabled by default during the
configuration. To enable it, add --enable-ecore-x-xcb. See the
messages that configure displays when it finishes.
* The way XCB is detected, and used in src/lib/ecore_x/Makefile.am
should be improved
* Any program that uses ecore_evas does not need to be modified.
Any program that uses ecore_x may need some changes. That is,
adding some functions (_prefetch and _fetch ones). No other
change is needed. See the documention of any _get functions, as
these are the ones that need those functions.
* There are some missing parts, especially everything that involves
the keyboard, as porting Xlib functions related to strings (utf8
stuff, XKeysymToString, etc...) is an horror. So keyboard events
are not working yet.
* I tried to write as much documentation as I could. But there is
certainly some missing doc here and there.
there are certainly other things that I have forgotten.
Improvements of that backend:
* the creation of an ecore_evas is faster. Especially when done over
an ssh connection (on my computer, 7-10s with Xlib, 1.5s with XCB,
over an ssh)
* A Window Manager should be more responsive. But it's not tomorrow
that e17 will use it :)
Have fun !
SVN revision: 29500
2007-04-13 10:15:19 -07:00
|
|
|
|
2006-03-08 00:02:55 -08:00
|
|
|
ee->driver = "software_x11";
|
2003-09-23 01:09:32 -07:00
|
|
|
if (disp_name) ee->name = strdup(disp_name);
|
|
|
|
|
|
|
|
if (w < 1) w = 1;
|
|
|
|
if (h < 1) h = 1;
|
|
|
|
ee->x = x;
|
|
|
|
ee->y = y;
|
|
|
|
ee->w = w;
|
|
|
|
ee->h = h;
|
2010-02-27 06:40:10 -08:00
|
|
|
ee->req.x = ee->x;
|
|
|
|
ee->req.y = ee->y;
|
|
|
|
ee->req.w = ee->w;
|
|
|
|
ee->req.h = ee->h;
|
Here is ecore_x with XCB backend.
* The XCB backend is disabled by default during the
configuration. To enable it, add --enable-ecore-x-xcb. See the
messages that configure displays when it finishes.
* The way XCB is detected, and used in src/lib/ecore_x/Makefile.am
should be improved
* Any program that uses ecore_evas does not need to be modified.
Any program that uses ecore_x may need some changes. That is,
adding some functions (_prefetch and _fetch ones). No other
change is needed. See the documention of any _get functions, as
these are the ones that need those functions.
* There are some missing parts, especially everything that involves
the keyboard, as porting Xlib functions related to strings (utf8
stuff, XKeysymToString, etc...) is an horror. So keyboard events
are not working yet.
* I tried to write as much documentation as I could. But there is
certainly some missing doc here and there.
there are certainly other things that I have forgotten.
Improvements of that backend:
* the creation of an ecore_evas is faster. Especially when done over
an ssh connection (on my computer, 7-10s with Xlib, 1.5s with XCB,
over an ssh)
* A Window Manager should be more responsive. But it's not tomorrow
that e17 will use it :)
Have fun !
SVN revision: 29500
2007-04-13 10:15:19 -07:00
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
ee->prop.max.w = 32767;
|
|
|
|
ee->prop.max.h = 32767;
|
|
|
|
ee->prop.layer = 4;
|
2014-01-12 21:26:36 -08:00
|
|
|
ee->prop.request_pos = EINA_FALSE;
|
2006-07-29 07:50:18 -07:00
|
|
|
ee->prop.sticky = 0;
|
2014-10-29 03:33:16 -07:00
|
|
|
ee->prop.withdrawn = EINA_TRUE;
|
2012-12-05 13:15:42 -08:00
|
|
|
edata->state.sticky = 0;
|
2013-01-17 06:31:34 -08:00
|
|
|
|
|
|
|
if (getenv("ECORE_EVAS_FORCE_SYNC_RENDER"))
|
|
|
|
ee->can_async_render = 0;
|
|
|
|
else
|
|
|
|
ee->can_async_render = 1;
|
Here is ecore_x with XCB backend.
* The XCB backend is disabled by default during the
configuration. To enable it, add --enable-ecore-x-xcb. See the
messages that configure displays when it finishes.
* The way XCB is detected, and used in src/lib/ecore_x/Makefile.am
should be improved
* Any program that uses ecore_evas does not need to be modified.
Any program that uses ecore_x may need some changes. That is,
adding some functions (_prefetch and _fetch ones). No other
change is needed. See the documention of any _get functions, as
these are the ones that need those functions.
* There are some missing parts, especially everything that involves
the keyboard, as porting Xlib functions related to strings (utf8
stuff, XKeysymToString, etc...) is an horror. So keyboard events
are not working yet.
* I tried to write as much documentation as I could. But there is
certainly some missing doc here and there.
there are certainly other things that I have forgotten.
Improvements of that backend:
* the creation of an ecore_evas is faster. Especially when done over
an ssh connection (on my computer, 7-10s with Xlib, 1.5s with XCB,
over an ssh)
* A Window Manager should be more responsive. But it's not tomorrow
that e17 will use it :)
Have fun !
SVN revision: 29500
2007-04-13 10:15:19 -07:00
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
/* init evas here */
|
|
|
|
ee->evas = evas_new();
|
2011-09-21 23:02:26 -07:00
|
|
|
evas_event_callback_add(ee->evas, EVAS_CALLBACK_RENDER_FLUSH_PRE,
|
2011-07-26 04:24:10 -07:00
|
|
|
_ecore_evas_x_flush_pre, ee);
|
2011-09-21 23:02:26 -07:00
|
|
|
evas_event_callback_add(ee->evas, EVAS_CALLBACK_RENDER_FLUSH_POST,
|
2011-07-26 04:24:10 -07:00
|
|
|
_ecore_evas_x_flush_post, ee);
|
2013-03-25 19:48:23 -07:00
|
|
|
if (ee->can_async_render)
|
|
|
|
evas_event_callback_add(ee->evas, EVAS_CALLBACK_RENDER_POST,
|
|
|
|
_ecore_evas_x_render_updates, ee);
|
2005-11-06 01:47:28 -08:00
|
|
|
evas_data_attach_set(ee->evas, ee);
|
2003-09-23 01:09:32 -07:00
|
|
|
evas_output_method_set(ee->evas, rmethod);
|
|
|
|
evas_output_size_set(ee->evas, w, h);
|
|
|
|
evas_output_viewport_set(ee->evas, 0, 0, w, h);
|
2005-04-25 01:28:27 -07:00
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
edata->win_root = parent;
|
|
|
|
edata->screen_num = 0;
|
2011-04-20 07:15:33 -07:00
|
|
|
|
2006-03-08 07:35:01 -08:00
|
|
|
if (parent != 0)
|
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
edata->screen_num = 1; /* FIXME: get real scren # */
|
Here is ecore_x with XCB backend.
* The XCB backend is disabled by default during the
configuration. To enable it, add --enable-ecore-x-xcb. See the
messages that configure displays when it finishes.
* The way XCB is detected, and used in src/lib/ecore_x/Makefile.am
should be improved
* Any program that uses ecore_evas does not need to be modified.
Any program that uses ecore_x may need some changes. That is,
adding some functions (_prefetch and _fetch ones). No other
change is needed. See the documention of any _get functions, as
these are the ones that need those functions.
* There are some missing parts, especially everything that involves
the keyboard, as porting Xlib functions related to strings (utf8
stuff, XKeysymToString, etc...) is an horror. So keyboard events
are not working yet.
* I tried to write as much documentation as I could. But there is
certainly some missing doc here and there.
there are certainly other things that I have forgotten.
Improvements of that backend:
* the creation of an ecore_evas is faster. Especially when done over
an ssh connection (on my computer, 7-10s with Xlib, 1.5s with XCB,
over an ssh)
* A Window Manager should be more responsive. But it's not tomorrow
that e17 will use it :)
Have fun !
SVN revision: 29500
2007-04-13 10:15:19 -07:00
|
|
|
/* FIXME: round trip in ecore_x_window_argb_get */
|
2010-09-29 10:03:38 -07:00
|
|
|
if (ecore_x_window_argb_get(parent))
|
|
|
|
{
|
|
|
|
ee->prop.window = ecore_x_window_argb_new(parent, x, y, w, h);
|
|
|
|
argb = 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
ee->prop.window = ecore_x_window_new(parent, x, y, w, h);
|
2006-03-08 07:35:01 -08:00
|
|
|
}
|
|
|
|
else
|
2009-03-16 09:24:43 -07:00
|
|
|
ee->prop.window = ecore_x_window_new(parent, x, y, w, h);
|
2014-07-24 22:45:50 -07:00
|
|
|
ecore_x_vsync_animator_tick_source_set(ee->prop.window);
|
2011-07-26 04:24:10 -07:00
|
|
|
if ((id = getenv("DESKTOP_STARTUP_ID")))
|
2005-09-13 20:26:23 -07:00
|
|
|
{
|
2011-07-26 04:24:10 -07:00
|
|
|
ecore_x_netwm_startup_id_set(ee->prop.window, id);
|
2010-09-29 10:03:38 -07:00
|
|
|
/* NB: on linux this may simply empty the env as opposed to completely
|
|
|
|
* unset it to being empty - unsure as solartis libc crashes looking
|
|
|
|
* for the '=' char */
|
|
|
|
// putenv((char*)"DESKTOP_STARTUP_ID=");
|
2005-09-13 20:26:23 -07:00
|
|
|
}
|
2003-09-23 01:09:32 -07:00
|
|
|
einfo = (Evas_Engine_Info_Software_X11 *)evas_engine_info_get(ee->evas);
|
|
|
|
if (einfo)
|
|
|
|
{
|
2011-07-26 04:24:10 -07:00
|
|
|
Ecore_X_Screen *screen;
|
2004-11-19 00:16:49 -08:00
|
|
|
|
2011-07-26 04:24:10 -07:00
|
|
|
/* FIXME: this is inefficient as its 1 or more round trips */
|
2010-09-29 10:03:38 -07:00
|
|
|
screen = ecore_x_default_screen_get();
|
2011-07-26 04:24:10 -07:00
|
|
|
if (ecore_x_screen_count_get() > 1)
|
2010-09-29 10:03:38 -07:00
|
|
|
{
|
|
|
|
Ecore_X_Window *roots;
|
|
|
|
int num, i;
|
|
|
|
|
|
|
|
num = 0;
|
|
|
|
roots = ecore_x_window_root_list(&num);
|
|
|
|
if (roots)
|
|
|
|
{
|
2011-07-26 04:24:10 -07:00
|
|
|
Ecore_X_Window root;
|
2010-09-29 10:03:38 -07:00
|
|
|
|
2011-07-26 04:24:10 -07:00
|
|
|
root = ecore_x_window_root_get(parent);
|
2011-09-21 23:02:26 -07:00
|
|
|
for (i = 0; i < num; i++)
|
2010-09-29 10:03:38 -07:00
|
|
|
{
|
2011-09-21 23:02:26 -07:00
|
|
|
if (root == roots[i])
|
2010-09-29 10:03:38 -07:00
|
|
|
{
|
2011-07-26 04:24:10 -07:00
|
|
|
screen = ecore_x_screen_get(i);
|
|
|
|
break;
|
2010-09-29 10:03:38 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
free(roots);
|
|
|
|
}
|
|
|
|
}
|
2011-07-26 04:24:10 -07:00
|
|
|
|
|
|
|
einfo->info.destination_alpha = argb;
|
Here is ecore_x with XCB backend.
* The XCB backend is disabled by default during the
configuration. To enable it, add --enable-ecore-x-xcb. See the
messages that configure displays when it finishes.
* The way XCB is detected, and used in src/lib/ecore_x/Makefile.am
should be improved
* Any program that uses ecore_evas does not need to be modified.
Any program that uses ecore_x may need some changes. That is,
adding some functions (_prefetch and _fetch ones). No other
change is needed. See the documention of any _get functions, as
these are the ones that need those functions.
* There are some missing parts, especially everything that involves
the keyboard, as porting Xlib functions related to strings (utf8
stuff, XKeysymToString, etc...) is an horror. So keyboard events
are not working yet.
* I tried to write as much documentation as I could. But there is
certainly some missing doc here and there.
there are certainly other things that I have forgotten.
Improvements of that backend:
* the creation of an ecore_evas is faster. Especially when done over
an ssh connection (on my computer, 7-10s with Xlib, 1.5s with XCB,
over an ssh)
* A Window Manager should be more responsive. But it's not tomorrow
that e17 will use it :)
Have fun !
SVN revision: 29500
2007-04-13 10:15:19 -07:00
|
|
|
|
2010-09-29 10:03:38 -07:00
|
|
|
if (redraw_debug < 0)
|
|
|
|
{
|
|
|
|
if (getenv("REDRAW_DEBUG"))
|
|
|
|
redraw_debug = atoi(getenv("REDRAW_DEBUG"));
|
|
|
|
else
|
|
|
|
redraw_debug = 0;
|
|
|
|
}
|
2011-07-26 04:24:10 -07:00
|
|
|
|
2008-07-23 03:00:01 -07:00
|
|
|
# ifdef BUILD_ECORE_EVAS_SOFTWARE_XCB
|
2009-07-14 14:18:27 -07:00
|
|
|
einfo->info.backend = EVAS_ENGINE_INFO_SOFTWARE_X11_BACKEND_XCB;
|
2010-09-29 10:03:38 -07:00
|
|
|
einfo->info.connection = ecore_x_connection_get();
|
|
|
|
einfo->info.screen = screen;
|
Here is ecore_x with XCB backend.
* The XCB backend is disabled by default during the
configuration. To enable it, add --enable-ecore-x-xcb. See the
messages that configure displays when it finishes.
* The way XCB is detected, and used in src/lib/ecore_x/Makefile.am
should be improved
* Any program that uses ecore_evas does not need to be modified.
Any program that uses ecore_x may need some changes. That is,
adding some functions (_prefetch and _fetch ones). No other
change is needed. See the documention of any _get functions, as
these are the ones that need those functions.
* There are some missing parts, especially everything that involves
the keyboard, as porting Xlib functions related to strings (utf8
stuff, XKeysymToString, etc...) is an horror. So keyboard events
are not working yet.
* I tried to write as much documentation as I could. But there is
certainly some missing doc here and there.
there are certainly other things that I have forgotten.
Improvements of that backend:
* the creation of an ecore_evas is faster. Especially when done over
an ssh connection (on my computer, 7-10s with Xlib, 1.5s with XCB,
over an ssh)
* A Window Manager should be more responsive. But it's not tomorrow
that e17 will use it :)
Have fun !
SVN revision: 29500
2007-04-13 10:15:19 -07:00
|
|
|
# else
|
2009-07-14 14:18:27 -07:00
|
|
|
einfo->info.backend = EVAS_ENGINE_INFO_SOFTWARE_X11_BACKEND_XLIB;
|
2010-09-29 10:03:38 -07:00
|
|
|
einfo->info.connection = ecore_x_display_get();
|
|
|
|
einfo->info.screen = NULL;
|
2011-07-26 04:24:10 -07:00
|
|
|
# endif
|
2010-09-29 10:03:38 -07:00
|
|
|
einfo->info.drawable = ee->prop.window;
|
Here is ecore_x with XCB backend.
* The XCB backend is disabled by default during the
configuration. To enable it, add --enable-ecore-x-xcb. See the
messages that configure displays when it finishes.
* The way XCB is detected, and used in src/lib/ecore_x/Makefile.am
should be improved
* Any program that uses ecore_evas does not need to be modified.
Any program that uses ecore_x may need some changes. That is,
adding some functions (_prefetch and _fetch ones). No other
change is needed. See the documention of any _get functions, as
these are the ones that need those functions.
* There are some missing parts, especially everything that involves
the keyboard, as porting Xlib functions related to strings (utf8
stuff, XKeysymToString, etc...) is an horror. So keyboard events
are not working yet.
* I tried to write as much documentation as I could. But there is
certainly some missing doc here and there.
there are certainly other things that I have forgotten.
Improvements of that backend:
* the creation of an ecore_evas is faster. Especially when done over
an ssh connection (on my computer, 7-10s with Xlib, 1.5s with XCB,
over an ssh)
* A Window Manager should be more responsive. But it's not tomorrow
that e17 will use it :)
Have fun !
SVN revision: 29500
2007-04-13 10:15:19 -07:00
|
|
|
|
2011-09-21 23:02:26 -07:00
|
|
|
if (argb)
|
2011-07-26 04:24:10 -07:00
|
|
|
{
|
2011-09-22 02:26:02 -07:00
|
|
|
Ecore_X_Window_Attributes at;
|
|
|
|
|
2011-07-26 04:24:10 -07:00
|
|
|
ecore_x_window_attributes_get(ee->prop.window, &at);
|
|
|
|
einfo->info.visual = at.visual;
|
|
|
|
einfo->info.colormap = at.colormap;
|
|
|
|
einfo->info.depth = at.depth;
|
|
|
|
einfo->info.destination_alpha = 1;
|
2010-09-29 10:03:38 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-09-21 23:02:26 -07:00
|
|
|
einfo->info.visual =
|
2011-07-26 04:24:10 -07:00
|
|
|
ecore_x_default_visual_get(einfo->info.connection, screen);
|
2011-09-21 23:02:26 -07:00
|
|
|
einfo->info.colormap =
|
2011-07-26 04:24:10 -07:00
|
|
|
ecore_x_default_colormap_get(einfo->info.connection, screen);
|
2011-09-21 23:02:26 -07:00
|
|
|
einfo->info.depth =
|
2011-07-26 04:24:10 -07:00
|
|
|
ecore_x_default_depth_get(einfo->info.connection, screen);
|
2010-09-29 10:03:38 -07:00
|
|
|
einfo->info.destination_alpha = 0;
|
|
|
|
}
|
2011-07-26 04:24:10 -07:00
|
|
|
|
2010-09-29 10:03:38 -07:00
|
|
|
einfo->info.rotation = 0;
|
2011-07-26 04:24:10 -07:00
|
|
|
einfo->info.debug = redraw_debug;
|
2010-05-17 20:50:17 -07:00
|
|
|
if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
|
|
|
|
{
|
2014-09-30 09:19:15 -07:00
|
|
|
ERR("evas_engine_info_set() init engine '%s' failed.", ee->driver);
|
2010-05-17 20:50:17 -07:00
|
|
|
ecore_evas_free(ee);
|
|
|
|
return NULL;
|
|
|
|
}
|
2003-09-23 01:09:32 -07:00
|
|
|
}
|
2011-04-20 07:15:33 -07:00
|
|
|
|
2012-02-27 22:43:59 -08:00
|
|
|
_ecore_evas_x_hints_update(ee);
|
2010-10-01 18:56:23 -07:00
|
|
|
_ecore_evas_x_group_leader_set(ee);
|
|
|
|
ecore_x_window_defaults_set(ee->prop.window);
|
|
|
|
_ecore_evas_x_protocols_set(ee);
|
2012-12-04 22:48:46 -08:00
|
|
|
_ecore_evas_x_window_profile_protocol_set(ee);
|
2014-02-08 16:46:51 -08:00
|
|
|
_ecore_evas_x_wm_rotation_protocol_set(ee);
|
2014-02-27 14:20:01 -08:00
|
|
|
_ecore_evas_x_aux_hints_supprted_update(ee);
|
|
|
|
_ecore_evas_x_aux_hints_update(ee);
|
2010-10-01 18:56:23 -07:00
|
|
|
_ecore_evas_x_sync_set(ee);
|
2003-09-23 01:09:32 -07:00
|
|
|
|
2010-01-06 21:29:06 -08:00
|
|
|
ee->engine.func->fn_render = _ecore_evas_x_render;
|
|
|
|
_ecore_evas_register(ee);
|
2015-02-04 01:58:48 -08:00
|
|
|
ecore_x_input_multi_select(ee->prop.window);
|
2010-12-07 19:25:23 -08:00
|
|
|
ecore_event_window_register(ee->prop.window, ee, ee->evas,
|
|
|
|
(Ecore_Event_Mouse_Move_Cb)_ecore_evas_mouse_move_process,
|
|
|
|
(Ecore_Event_Multi_Move_Cb)_ecore_evas_mouse_multi_move_process,
|
|
|
|
(Ecore_Event_Multi_Down_Cb)_ecore_evas_mouse_multi_down_process,
|
|
|
|
(Ecore_Event_Multi_Up_Cb)_ecore_evas_mouse_multi_up_process);
|
2003-09-23 01:09:32 -07:00
|
|
|
return ee;
|
2009-04-11 03:31:42 -07:00
|
|
|
}
|
2003-09-23 01:09:32 -07:00
|
|
|
|
2013-07-05 02:38:43 -07:00
|
|
|
EAPI Ecore_Evas *
|
|
|
|
ecore_evas_software_x11_pixmap_new_internal(const char *disp_name, Ecore_X_Window parent,
|
|
|
|
int x, int y, int w, int h)
|
|
|
|
{
|
|
|
|
Evas_Engine_Info_Software_X11 *einfo;
|
|
|
|
Ecore_Evas_Interface_X11 *iface;
|
|
|
|
Ecore_Evas_Interface_Software_X11 *siface;
|
|
|
|
Ecore_Evas_Engine_Data_X11 *edata;
|
|
|
|
Ecore_Evas *ee;
|
|
|
|
int argb = 0, rmethod;
|
|
|
|
static int redraw_debug = -1;
|
|
|
|
|
|
|
|
rmethod = evas_render_method_lookup("software_x11");
|
|
|
|
if (!rmethod) return NULL;
|
|
|
|
if (!ecore_x_init(disp_name)) return NULL;
|
|
|
|
ee = calloc(1, sizeof(Ecore_Evas));
|
|
|
|
if (!ee) return NULL;
|
|
|
|
edata = calloc(1, sizeof(Ecore_Evas_Engine_Data_X11));
|
|
|
|
if (!edata)
|
|
|
|
{
|
|
|
|
free(ee);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
ee->engine.data = edata;
|
|
|
|
iface = _ecore_evas_x_interface_x11_new();
|
|
|
|
siface = _ecore_evas_x_interface_software_x11_new();
|
|
|
|
|
|
|
|
ee->engine.ifaces = eina_list_append(ee->engine.ifaces, iface);
|
|
|
|
ee->engine.ifaces = eina_list_append(ee->engine.ifaces, siface);
|
|
|
|
|
|
|
|
ECORE_MAGIC_SET(ee, ECORE_MAGIC_EVAS);
|
|
|
|
|
|
|
|
_ecore_evas_x_init();
|
|
|
|
|
|
|
|
ee->engine.func = (Ecore_Evas_Engine_Func *)&_ecore_x_engine_func;
|
|
|
|
|
|
|
|
ee->driver = "software_x11";
|
|
|
|
if (disp_name) ee->name = strdup(disp_name);
|
|
|
|
|
|
|
|
if (w < 1) w = 1;
|
|
|
|
if (h < 1) h = 1;
|
|
|
|
ee->x = x;
|
|
|
|
ee->y = y;
|
|
|
|
ee->w = w;
|
|
|
|
ee->h = h;
|
|
|
|
ee->req.x = ee->x;
|
|
|
|
ee->req.y = ee->y;
|
|
|
|
ee->req.w = ee->w;
|
|
|
|
ee->req.h = ee->h;
|
|
|
|
|
|
|
|
ee->prop.max.w = 32767;
|
|
|
|
ee->prop.max.h = 32767;
|
|
|
|
ee->prop.layer = 4;
|
2014-01-12 21:26:36 -08:00
|
|
|
ee->prop.request_pos = EINA_FALSE;
|
2013-07-05 02:38:43 -07:00
|
|
|
ee->prop.sticky = 0;
|
|
|
|
edata->state.sticky = 0;
|
|
|
|
|
|
|
|
if (getenv("ECORE_EVAS_FORCE_SYNC_RENDER"))
|
|
|
|
ee->can_async_render = 0;
|
|
|
|
else
|
|
|
|
ee->can_async_render = 1;
|
|
|
|
|
|
|
|
/* init evas here */
|
|
|
|
ee->evas = evas_new();
|
|
|
|
|
|
|
|
evas_event_callback_add(ee->evas, EVAS_CALLBACK_RENDER_FLUSH_PRE,
|
|
|
|
_ecore_evas_x_flush_pre, ee);
|
|
|
|
evas_event_callback_add(ee->evas, EVAS_CALLBACK_RENDER_FLUSH_POST,
|
|
|
|
_ecore_evas_x_flush_post, ee);
|
|
|
|
evas_event_callback_add(ee->evas, EVAS_CALLBACK_RENDER_PRE,
|
|
|
|
_ecore_evas_x_render_pre, ee);
|
|
|
|
|
|
|
|
if (ee->can_async_render)
|
|
|
|
evas_event_callback_add(ee->evas, EVAS_CALLBACK_RENDER_POST,
|
|
|
|
_ecore_evas_x_render_updates, ee);
|
|
|
|
evas_data_attach_set(ee->evas, ee);
|
|
|
|
evas_output_method_set(ee->evas, rmethod);
|
|
|
|
evas_output_size_set(ee->evas, w, h);
|
|
|
|
evas_output_viewport_set(ee->evas, 0, 0, w, h);
|
|
|
|
|
|
|
|
edata->win_root = parent;
|
|
|
|
edata->screen_num = 0;
|
|
|
|
edata->direct_resize = 1;
|
|
|
|
|
|
|
|
if (parent != 0)
|
|
|
|
{
|
|
|
|
edata->screen_num = 1; /* FIXME: get real scren # */
|
|
|
|
/* FIXME: round trip in ecore_x_window_argb_get */
|
|
|
|
if (ecore_x_window_argb_get(parent))
|
|
|
|
argb = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* if ((id = getenv("DESKTOP_STARTUP_ID"))) */
|
|
|
|
/* { */
|
|
|
|
/* ecore_x_netwm_startup_id_set(ee->prop.window, id); */
|
|
|
|
/* NB: on linux this may simply empty the env as opposed to completely
|
|
|
|
* unset it to being empty - unsure as solartis libc crashes looking
|
|
|
|
* for the '=' char */
|
|
|
|
// putenv((char*)"DESKTOP_STARTUP_ID=");
|
|
|
|
/* } */
|
|
|
|
|
|
|
|
einfo = (Evas_Engine_Info_Software_X11 *)evas_engine_info_get(ee->evas);
|
|
|
|
if (einfo)
|
|
|
|
{
|
|
|
|
Ecore_X_Screen *screen;
|
|
|
|
|
|
|
|
/* FIXME: this is inefficient as its 1 or more round trips */
|
|
|
|
screen = ecore_x_default_screen_get();
|
|
|
|
if (ecore_x_screen_count_get() > 1)
|
|
|
|
{
|
|
|
|
Ecore_X_Window *roots;
|
|
|
|
int num, i;
|
|
|
|
|
|
|
|
num = 0;
|
|
|
|
roots = ecore_x_window_root_list(&num);
|
|
|
|
if (roots)
|
|
|
|
{
|
|
|
|
Ecore_X_Window root;
|
|
|
|
|
|
|
|
root = ecore_x_window_root_get(parent);
|
|
|
|
for (i = 0; i < num; i++)
|
|
|
|
{
|
|
|
|
if (root == roots[i])
|
|
|
|
{
|
|
|
|
screen = ecore_x_screen_get(i);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
free(roots);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
einfo->info.destination_alpha = argb;
|
|
|
|
|
|
|
|
if (redraw_debug < 0)
|
|
|
|
{
|
|
|
|
if (getenv("REDRAW_DEBUG"))
|
|
|
|
redraw_debug = atoi(getenv("REDRAW_DEBUG"));
|
|
|
|
else
|
|
|
|
redraw_debug = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
# ifdef BUILD_ECORE_EVAS_SOFTWARE_XCB
|
|
|
|
einfo->info.backend = EVAS_ENGINE_INFO_SOFTWARE_X11_BACKEND_XCB;
|
|
|
|
einfo->info.connection = ecore_x_connection_get();
|
|
|
|
einfo->info.screen = screen;
|
|
|
|
# else
|
|
|
|
einfo->info.backend = EVAS_ENGINE_INFO_SOFTWARE_X11_BACKEND_XLIB;
|
|
|
|
einfo->info.connection = ecore_x_display_get();
|
|
|
|
einfo->info.screen = NULL;
|
|
|
|
# endif
|
|
|
|
|
2013-07-05 03:09:25 -07:00
|
|
|
if ((argb) && (ee->prop.window))
|
2013-07-05 02:38:43 -07:00
|
|
|
{
|
|
|
|
Ecore_X_Window_Attributes at;
|
|
|
|
|
|
|
|
ecore_x_window_attributes_get(ee->prop.window, &at);
|
|
|
|
einfo->info.visual = at.visual;
|
|
|
|
einfo->info.colormap = at.colormap;
|
|
|
|
einfo->info.depth = at.depth;
|
|
|
|
einfo->info.destination_alpha = 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
einfo->info.visual =
|
|
|
|
ecore_x_default_visual_get(einfo->info.connection, screen);
|
|
|
|
einfo->info.colormap =
|
|
|
|
ecore_x_default_colormap_get(einfo->info.connection, screen);
|
|
|
|
einfo->info.depth =
|
|
|
|
ecore_x_default_depth_get(einfo->info.connection, screen);
|
|
|
|
einfo->info.destination_alpha = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
einfo->info.rotation = 0;
|
|
|
|
einfo->info.debug = redraw_debug;
|
|
|
|
|
|
|
|
/* record pixmap size to save X roundtrips */
|
|
|
|
edata->pixmap.w = w;
|
|
|
|
edata->pixmap.h = h;
|
|
|
|
edata->pixmap.depth = einfo->info.depth;
|
2013-07-11 02:47:08 -07:00
|
|
|
edata->pixmap.visual = einfo->info.visual;
|
|
|
|
edata->pixmap.colormap = einfo->info.colormap;
|
2013-07-05 02:38:43 -07:00
|
|
|
|
|
|
|
/* create front and back pixmaps for double-buffer rendering */
|
|
|
|
edata->pixmap.front =
|
|
|
|
ecore_x_pixmap_new(parent, w, h, edata->pixmap.depth);
|
|
|
|
edata->pixmap.back =
|
|
|
|
ecore_x_pixmap_new(parent, w, h, edata->pixmap.depth);
|
|
|
|
|
|
|
|
einfo->info.drawable = edata->pixmap.back;
|
|
|
|
|
|
|
|
if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
|
|
|
|
{
|
2014-09-30 09:19:15 -07:00
|
|
|
ERR("evas_engine_info_set() init engine '%s' failed.", ee->driver);
|
2013-07-05 02:38:43 -07:00
|
|
|
ecore_evas_free(ee);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* FIXME: Allow of these set properties or do something with the
|
|
|
|
* ee->prop.window (x window), which we do not have in pixmap case */
|
|
|
|
|
|
|
|
/* _ecore_evas_x_hints_update(ee); */
|
|
|
|
/* _ecore_evas_x_group_leader_set(ee); */
|
|
|
|
/* ecore_x_window_defaults_set(ee->prop.window); */
|
|
|
|
/* _ecore_evas_x_protocols_set(ee); */
|
|
|
|
/* _ecore_evas_x_window_profile_protocol_set(ee); */
|
|
|
|
/* _ecore_evas_x_sync_set(ee); */
|
|
|
|
|
|
|
|
ee->engine.func->fn_render = _ecore_evas_x_render;
|
|
|
|
_ecore_evas_register(ee);
|
|
|
|
|
|
|
|
ee->draw_ok = 1;
|
|
|
|
|
2015-02-04 01:58:48 -08:00
|
|
|
/* ecore_x_input_multi_select(ee->prop.window); */
|
2013-07-05 02:38:43 -07:00
|
|
|
/* ecore_event_window_register(ee->prop.window, ee, ee->evas, */
|
|
|
|
/* (Ecore_Event_Mouse_Move_Cb)_ecore_evas_mouse_move_process, */
|
|
|
|
/* (Ecore_Event_Multi_Move_Cb)_ecore_evas_mouse_multi_move_process, */
|
|
|
|
/* (Ecore_Event_Multi_Down_Cb)_ecore_evas_mouse_multi_down_process, */
|
|
|
|
/* (Ecore_Event_Multi_Up_Cb)_ecore_evas_mouse_multi_up_process); */
|
|
|
|
|
|
|
|
return ee;
|
|
|
|
}
|
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
static Ecore_X_Window
|
|
|
|
_ecore_evas_software_x11_window_get(const Ecore_Evas *ee)
|
2004-08-27 03:02:45 -07:00
|
|
|
{
|
2012-05-28 05:24:30 -07:00
|
|
|
if (!(!strcmp(ee->driver, "software_x11"))) return 0;
|
2009-03-16 09:24:43 -07:00
|
|
|
return (Ecore_X_Window) ecore_evas_window_get(ee);
|
2009-04-11 03:31:42 -07:00
|
|
|
}
|
2004-08-27 03:02:45 -07:00
|
|
|
|
2013-07-05 02:38:43 -07:00
|
|
|
static Ecore_X_Pixmap
|
|
|
|
_ecore_evas_software_x11_pixmap_get(const Ecore_Evas *ee)
|
|
|
|
{
|
|
|
|
if (!(!strcmp(ee->driver, "software_x11"))) return 0;
|
|
|
|
Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
|
|
|
|
return (Ecore_X_Pixmap) edata->pixmap.front;
|
|
|
|
}
|
|
|
|
|
2013-07-11 02:47:08 -07:00
|
|
|
static void *
|
|
|
|
_ecore_evas_software_x11_pixmap_visual_get(const Ecore_Evas *ee)
|
|
|
|
{
|
|
|
|
if (!(!strcmp(ee->driver, "software_x11"))) return 0;
|
|
|
|
Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
|
|
|
|
return edata->pixmap.visual;
|
|
|
|
}
|
|
|
|
|
|
|
|
static unsigned long
|
|
|
|
_ecore_evas_software_x11_pixmap_colormap_get(const Ecore_Evas *ee)
|
|
|
|
{
|
|
|
|
if (!(!strcmp(ee->driver, "software_x11"))) return 0;
|
|
|
|
Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
|
|
|
|
return edata->pixmap.colormap;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
_ecore_evas_software_x11_pixmap_depth_get(const Ecore_Evas *ee)
|
|
|
|
{
|
|
|
|
if (!(!strcmp(ee->driver, "software_x11"))) return 0;
|
|
|
|
Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
|
|
|
|
return edata->pixmap.depth;
|
|
|
|
}
|
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
static void
|
|
|
|
_ecore_evas_software_x11_direct_resize_set(Ecore_Evas *ee, Eina_Bool on)
|
2004-11-23 07:17:56 -08:00
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
|
|
|
|
edata->direct_resize = on;
|
2005-06-25 00:23:38 -07:00
|
|
|
if (ee->prop.avoid_damage)
|
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
if (edata->direct_resize)
|
2010-09-29 10:03:38 -07:00
|
|
|
{
|
Here is ecore_x with XCB backend.
* The XCB backend is disabled by default during the
configuration. To enable it, add --enable-ecore-x-xcb. See the
messages that configure displays when it finishes.
* The way XCB is detected, and used in src/lib/ecore_x/Makefile.am
should be improved
* Any program that uses ecore_evas does not need to be modified.
Any program that uses ecore_x may need some changes. That is,
adding some functions (_prefetch and _fetch ones). No other
change is needed. See the documention of any _get functions, as
these are the ones that need those functions.
* There are some missing parts, especially everything that involves
the keyboard, as porting Xlib functions related to strings (utf8
stuff, XKeysymToString, etc...) is an horror. So keyboard events
are not working yet.
* I tried to write as much documentation as I could. But there is
certainly some missing doc here and there.
there are certainly other things that I have forgotten.
Improvements of that backend:
* the creation of an ecore_evas is faster. Especially when done over
an ssh connection (on my computer, 7-10s with Xlib, 1.5s with XCB,
over an ssh)
* A Window Manager should be more responsive. But it's not tomorrow
that e17 will use it :)
Have fun !
SVN revision: 29500
2007-04-13 10:15:19 -07:00
|
|
|
/* turn this off for now
|
2010-09-29 10:03:38 -07:00
|
|
|
ee->engine.x.using_bg_pixmap = 1;
|
|
|
|
ecore_x_window_pixmap_set(ee->prop.window, ee->engine.x.pmap);
|
2005-06-29 23:32:30 -07:00
|
|
|
*/
|
2010-09-29 10:03:38 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2008-07-14 03:06:34 -07:00
|
|
|
/* turn this off too- bg pixmap is controlled by avoid damage directly
|
2010-09-29 10:03:38 -07:00
|
|
|
ee->engine.x.using_bg_pixmap = 0;
|
|
|
|
ecore_x_window_pixmap_set(ee->prop.window, 0);
|
|
|
|
ecore_x_window_area_expose(ee->prop.window, 0, 0, ee->w, ee->h);
|
2007-10-02 23:31:05 -07:00
|
|
|
*/
|
2010-09-29 10:03:38 -07:00
|
|
|
}
|
2005-06-25 00:23:38 -07:00
|
|
|
}
|
2009-04-11 03:31:42 -07:00
|
|
|
}
|
2004-11-23 07:17:56 -08:00
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
static Eina_Bool
|
|
|
|
_ecore_evas_software_x11_direct_resize_get(const Ecore_Evas *ee)
|
2009-04-11 03:31:42 -07:00
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
|
|
|
|
|
|
|
|
return edata->direct_resize;
|
2004-11-23 07:17:56 -08:00
|
|
|
}
|
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
static void
|
|
|
|
_ecore_evas_software_x11_extra_event_window_add(Ecore_Evas *ee, Ecore_X_Window win)
|
2005-09-24 02:00:23 -07:00
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
|
2005-09-24 02:00:23 -07:00
|
|
|
Ecore_X_Window *winp;
|
Here is ecore_x with XCB backend.
* The XCB backend is disabled by default during the
configuration. To enable it, add --enable-ecore-x-xcb. See the
messages that configure displays when it finishes.
* The way XCB is detected, and used in src/lib/ecore_x/Makefile.am
should be improved
* Any program that uses ecore_evas does not need to be modified.
Any program that uses ecore_x may need some changes. That is,
adding some functions (_prefetch and _fetch ones). No other
change is needed. See the documention of any _get functions, as
these are the ones that need those functions.
* There are some missing parts, especially everything that involves
the keyboard, as porting Xlib functions related to strings (utf8
stuff, XKeysymToString, etc...) is an horror. So keyboard events
are not working yet.
* I tried to write as much documentation as I could. But there is
certainly some missing doc here and there.
there are certainly other things that I have forgotten.
Improvements of that backend:
* the creation of an ecore_evas is faster. Especially when done over
an ssh connection (on my computer, 7-10s with Xlib, 1.5s with XCB,
over an ssh)
* A Window Manager should be more responsive. But it's not tomorrow
that e17 will use it :)
Have fun !
SVN revision: 29500
2007-04-13 10:15:19 -07:00
|
|
|
|
2005-09-24 02:00:23 -07:00
|
|
|
winp = malloc(sizeof(Ecore_X_Window));
|
|
|
|
if (winp)
|
|
|
|
{
|
2010-09-29 10:03:38 -07:00
|
|
|
*winp = win;
|
2012-12-05 13:15:42 -08:00
|
|
|
edata->win_extra = eina_list_append(edata->win_extra, winp);
|
2015-02-04 01:58:48 -08:00
|
|
|
ecore_x_input_multi_select(win);
|
2010-12-07 19:25:23 -08:00
|
|
|
ecore_event_window_register(win, ee, ee->evas,
|
|
|
|
(Ecore_Event_Mouse_Move_Cb)_ecore_evas_mouse_move_process,
|
|
|
|
(Ecore_Event_Multi_Move_Cb)_ecore_evas_mouse_multi_move_process,
|
|
|
|
(Ecore_Event_Multi_Down_Cb)_ecore_evas_mouse_multi_down_process,
|
|
|
|
(Ecore_Event_Multi_Up_Cb)_ecore_evas_mouse_multi_up_process);
|
2005-09-24 02:00:23 -07:00
|
|
|
}
|
2009-04-11 03:31:42 -07:00
|
|
|
}
|
|
|
|
#endif
|
2005-09-24 02:00:23 -07:00
|
|
|
|
2009-04-11 03:31:42 -07:00
|
|
|
#ifdef BUILD_ECORE_EVAS_OPENGL_X11
|
2006-01-06 10:46:30 -08:00
|
|
|
EAPI Ecore_Evas *
|
2012-12-05 13:15:42 -08:00
|
|
|
ecore_evas_gl_x11_options_new_internal(const char *disp_name, Ecore_X_Window parent,
|
|
|
|
int x, int y, int w, int h, const int *opt)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
|
|
|
Ecore_Evas *ee;
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Engine_Data_X11 *edata;
|
|
|
|
Ecore_Evas_Interface_X11 *iface;
|
|
|
|
Ecore_Evas_Interface_Gl_X11 *giface;
|
2003-09-23 01:09:32 -07:00
|
|
|
int rmethod;
|
2011-07-26 04:24:10 -07:00
|
|
|
char *id = NULL;
|
2003-09-23 01:09:32 -07:00
|
|
|
|
|
|
|
rmethod = evas_render_method_lookup("gl_x11");
|
|
|
|
if (!rmethod) return NULL;
|
|
|
|
if (!ecore_x_init(disp_name)) return NULL;
|
|
|
|
ee = calloc(1, sizeof(Ecore_Evas));
|
|
|
|
if (!ee) return NULL;
|
2012-12-05 13:15:42 -08:00
|
|
|
edata = calloc(1, sizeof(Ecore_Evas_Engine_Data_X11));
|
|
|
|
if (!edata)
|
|
|
|
{
|
|
|
|
free(ee);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
iface = _ecore_evas_x_interface_x11_new();
|
|
|
|
giface = _ecore_evas_x_interface_gl_x11_new();
|
|
|
|
|
|
|
|
ee->engine.ifaces = eina_list_append(ee->engine.ifaces, iface);
|
|
|
|
ee->engine.ifaces = eina_list_append(ee->engine.ifaces, giface);
|
|
|
|
|
|
|
|
ee->engine.data = edata;
|
Here is ecore_x with XCB backend.
* The XCB backend is disabled by default during the
configuration. To enable it, add --enable-ecore-x-xcb. See the
messages that configure displays when it finishes.
* The way XCB is detected, and used in src/lib/ecore_x/Makefile.am
should be improved
* Any program that uses ecore_evas does not need to be modified.
Any program that uses ecore_x may need some changes. That is,
adding some functions (_prefetch and _fetch ones). No other
change is needed. See the documention of any _get functions, as
these are the ones that need those functions.
* There are some missing parts, especially everything that involves
the keyboard, as porting Xlib functions related to strings (utf8
stuff, XKeysymToString, etc...) is an horror. So keyboard events
are not working yet.
* I tried to write as much documentation as I could. But there is
certainly some missing doc here and there.
there are certainly other things that I have forgotten.
Improvements of that backend:
* the creation of an ecore_evas is faster. Especially when done over
an ssh connection (on my computer, 7-10s with Xlib, 1.5s with XCB,
over an ssh)
* A Window Manager should be more responsive. But it's not tomorrow
that e17 will use it :)
Have fun !
SVN revision: 29500
2007-04-13 10:15:19 -07:00
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
ECORE_MAGIC_SET(ee, ECORE_MAGIC_EVAS);
|
Here is ecore_x with XCB backend.
* The XCB backend is disabled by default during the
configuration. To enable it, add --enable-ecore-x-xcb. See the
messages that configure displays when it finishes.
* The way XCB is detected, and used in src/lib/ecore_x/Makefile.am
should be improved
* Any program that uses ecore_evas does not need to be modified.
Any program that uses ecore_x may need some changes. That is,
adding some functions (_prefetch and _fetch ones). No other
change is needed. See the documention of any _get functions, as
these are the ones that need those functions.
* There are some missing parts, especially everything that involves
the keyboard, as porting Xlib functions related to strings (utf8
stuff, XKeysymToString, etc...) is an horror. So keyboard events
are not working yet.
* I tried to write as much documentation as I could. But there is
certainly some missing doc here and there.
there are certainly other things that I have forgotten.
Improvements of that backend:
* the creation of an ecore_evas is faster. Especially when done over
an ssh connection (on my computer, 7-10s with Xlib, 1.5s with XCB,
over an ssh)
* A Window Manager should be more responsive. But it's not tomorrow
that e17 will use it :)
Have fun !
SVN revision: 29500
2007-04-13 10:15:19 -07:00
|
|
|
|
2013-12-18 06:47:29 -08:00
|
|
|
ee->gl_sync_draw_done = -1;
|
2012-07-03 00:44:17 -07:00
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
_ecore_evas_x_init();
|
Here is ecore_x with XCB backend.
* The XCB backend is disabled by default during the
configuration. To enable it, add --enable-ecore-x-xcb. See the
messages that configure displays when it finishes.
* The way XCB is detected, and used in src/lib/ecore_x/Makefile.am
should be improved
* Any program that uses ecore_evas does not need to be modified.
Any program that uses ecore_x may need some changes. That is,
adding some functions (_prefetch and _fetch ones). No other
change is needed. See the documention of any _get functions, as
these are the ones that need those functions.
* There are some missing parts, especially everything that involves
the keyboard, as porting Xlib functions related to strings (utf8
stuff, XKeysymToString, etc...) is an horror. So keyboard events
are not working yet.
* I tried to write as much documentation as I could. But there is
certainly some missing doc here and there.
there are certainly other things that I have forgotten.
Improvements of that backend:
* the creation of an ecore_evas is faster. Especially when done over
an ssh connection (on my computer, 7-10s with Xlib, 1.5s with XCB,
over an ssh)
* A Window Manager should be more responsive. But it's not tomorrow
that e17 will use it :)
Have fun !
SVN revision: 29500
2007-04-13 10:15:19 -07:00
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
ee->engine.func = (Ecore_Evas_Engine_Func *)&_ecore_x_engine_func;
|
Here is ecore_x with XCB backend.
* The XCB backend is disabled by default during the
configuration. To enable it, add --enable-ecore-x-xcb. See the
messages that configure displays when it finishes.
* The way XCB is detected, and used in src/lib/ecore_x/Makefile.am
should be improved
* Any program that uses ecore_evas does not need to be modified.
Any program that uses ecore_x may need some changes. That is,
adding some functions (_prefetch and _fetch ones). No other
change is needed. See the documention of any _get functions, as
these are the ones that need those functions.
* There are some missing parts, especially everything that involves
the keyboard, as porting Xlib functions related to strings (utf8
stuff, XKeysymToString, etc...) is an horror. So keyboard events
are not working yet.
* I tried to write as much documentation as I could. But there is
certainly some missing doc here and there.
there are certainly other things that I have forgotten.
Improvements of that backend:
* the creation of an ecore_evas is faster. Especially when done over
an ssh connection (on my computer, 7-10s with Xlib, 1.5s with XCB,
over an ssh)
* A Window Manager should be more responsive. But it's not tomorrow
that e17 will use it :)
Have fun !
SVN revision: 29500
2007-04-13 10:15:19 -07:00
|
|
|
|
2008-10-29 12:31:05 -07:00
|
|
|
ee->driver = "opengl_x11";
|
2012-07-03 00:44:17 -07:00
|
|
|
#if 1
|
|
|
|
ee->semi_sync = 0; // gl engine doesn't need to sync - its whole swaps
|
|
|
|
#else
|
2011-10-19 23:39:03 -07:00
|
|
|
if (!getenv("ECORE_EVAS_COMP_NOSEMISYNC"))
|
|
|
|
ee->semi_sync = 1; // gl engine doesn't need to sync - its whole swaps
|
2011-05-30 09:17:07 -07:00
|
|
|
// ee->no_comp_sync = 1; // gl engine doesn't need to sync - its whole swaps
|
2012-07-03 00:44:17 -07:00
|
|
|
#endif
|
2003-09-23 01:09:32 -07:00
|
|
|
if (disp_name) ee->name = strdup(disp_name);
|
|
|
|
|
|
|
|
if (w < 1) w = 1;
|
|
|
|
if (h < 1) h = 1;
|
|
|
|
ee->x = x;
|
|
|
|
ee->y = y;
|
|
|
|
ee->w = w;
|
|
|
|
ee->h = h;
|
2010-02-27 06:40:10 -08:00
|
|
|
ee->req.x = ee->x;
|
|
|
|
ee->req.y = ee->y;
|
|
|
|
ee->req.w = ee->w;
|
|
|
|
ee->req.h = ee->h;
|
Here is ecore_x with XCB backend.
* The XCB backend is disabled by default during the
configuration. To enable it, add --enable-ecore-x-xcb. See the
messages that configure displays when it finishes.
* The way XCB is detected, and used in src/lib/ecore_x/Makefile.am
should be improved
* Any program that uses ecore_evas does not need to be modified.
Any program that uses ecore_x may need some changes. That is,
adding some functions (_prefetch and _fetch ones). No other
change is needed. See the documention of any _get functions, as
these are the ones that need those functions.
* There are some missing parts, especially everything that involves
the keyboard, as porting Xlib functions related to strings (utf8
stuff, XKeysymToString, etc...) is an horror. So keyboard events
are not working yet.
* I tried to write as much documentation as I could. But there is
certainly some missing doc here and there.
there are certainly other things that I have forgotten.
Improvements of that backend:
* the creation of an ecore_evas is faster. Especially when done over
an ssh connection (on my computer, 7-10s with Xlib, 1.5s with XCB,
over an ssh)
* A Window Manager should be more responsive. But it's not tomorrow
that e17 will use it :)
Have fun !
SVN revision: 29500
2007-04-13 10:15:19 -07:00
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
ee->prop.max.w = 32767;
|
|
|
|
ee->prop.max.h = 32767;
|
|
|
|
ee->prop.layer = 4;
|
2014-01-12 21:26:36 -08:00
|
|
|
ee->prop.request_pos = EINA_FALSE;
|
2006-07-29 07:50:18 -07:00
|
|
|
ee->prop.sticky = 0;
|
2014-10-29 03:33:16 -07:00
|
|
|
ee->prop.withdrawn = EINA_TRUE;
|
2012-12-05 13:15:42 -08:00
|
|
|
edata->state.sticky = 0;
|
Here is ecore_x with XCB backend.
* The XCB backend is disabled by default during the
configuration. To enable it, add --enable-ecore-x-xcb. See the
messages that configure displays when it finishes.
* The way XCB is detected, and used in src/lib/ecore_x/Makefile.am
should be improved
* Any program that uses ecore_evas does not need to be modified.
Any program that uses ecore_x may need some changes. That is,
adding some functions (_prefetch and _fetch ones). No other
change is needed. See the documention of any _get functions, as
these are the ones that need those functions.
* There are some missing parts, especially everything that involves
the keyboard, as porting Xlib functions related to strings (utf8
stuff, XKeysymToString, etc...) is an horror. So keyboard events
are not working yet.
* I tried to write as much documentation as I could. But there is
certainly some missing doc here and there.
there are certainly other things that I have forgotten.
Improvements of that backend:
* the creation of an ecore_evas is faster. Especially when done over
an ssh connection (on my computer, 7-10s with Xlib, 1.5s with XCB,
over an ssh)
* A Window Manager should be more responsive. But it's not tomorrow
that e17 will use it :)
Have fun !
SVN revision: 29500
2007-04-13 10:15:19 -07:00
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
/* init evas here */
|
|
|
|
ee->evas = evas_new();
|
2010-02-01 06:13:48 -08:00
|
|
|
evas_event_callback_add(ee->evas, EVAS_CALLBACK_RENDER_FLUSH_PRE, _ecore_evas_x_flush_pre, ee);
|
|
|
|
evas_event_callback_add(ee->evas, EVAS_CALLBACK_RENDER_FLUSH_POST, _ecore_evas_x_flush_post, ee);
|
2005-11-06 01:47:28 -08:00
|
|
|
evas_data_attach_set(ee->evas, ee);
|
2003-09-23 01:09:32 -07:00
|
|
|
evas_output_method_set(ee->evas, rmethod);
|
|
|
|
evas_output_size_set(ee->evas, w, h);
|
|
|
|
evas_output_viewport_set(ee->evas, 0, 0, w, h);
|
2006-03-08 00:02:55 -08:00
|
|
|
|
2013-01-07 19:49:49 -08:00
|
|
|
if (parent == 0) parent = ecore_x_window_root_first_get();
|
2012-12-05 13:15:42 -08:00
|
|
|
edata->win_root = parent;
|
2009-06-23 02:55:47 -07:00
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
if (edata->win_root != 0)
|
2010-02-28 20:44:36 -08:00
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
edata->screen_num = 1; /* FIXME: get real scren # */
|
2010-02-28 20:44:36 -08:00
|
|
|
/* FIXME: round trip in ecore_x_window_argb_get */
|
2012-12-05 13:15:42 -08:00
|
|
|
if (ecore_x_window_argb_get(edata->win_root))
|
2010-09-29 10:03:38 -07:00
|
|
|
{
|
2010-02-28 20:44:36 -08:00
|
|
|
ee->prop.window = _ecore_evas_x_gl_window_new
|
2012-12-05 13:15:42 -08:00
|
|
|
(ee, edata->win_root, x, y, w, h, 0, 1, opt);
|
2010-09-29 10:03:38 -07:00
|
|
|
}
|
|
|
|
else
|
2010-02-28 20:44:36 -08:00
|
|
|
ee->prop.window = _ecore_evas_x_gl_window_new
|
2012-12-05 13:15:42 -08:00
|
|
|
(ee, edata->win_root, x, y, w, h, 0, 0, opt);
|
2010-02-28 20:44:36 -08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
ee->prop.window = _ecore_evas_x_gl_window_new
|
2012-12-05 13:15:42 -08:00
|
|
|
(ee, edata->win_root, x, y, w, h, 0, 0, opt);
|
2010-02-14 21:26:42 -08:00
|
|
|
if (!ee->prop.window)
|
|
|
|
{
|
2014-09-30 09:19:15 -07:00
|
|
|
ERR("evas_engine_info_set() init engine '%s' failed.", ee->driver);
|
2010-02-14 21:26:42 -08:00
|
|
|
ecore_evas_free(ee);
|
|
|
|
return NULL;
|
|
|
|
}
|
2011-07-26 04:24:10 -07:00
|
|
|
if ((id = getenv("DESKTOP_STARTUP_ID")))
|
2005-09-13 20:26:23 -07:00
|
|
|
{
|
2011-07-26 04:24:10 -07:00
|
|
|
ecore_x_netwm_startup_id_set(ee->prop.window, id);
|
2010-09-29 10:03:38 -07:00
|
|
|
/* NB: on linux this may simply empty the env as opposed to completely
|
|
|
|
* unset it to being empty - unsure as solartis libc crashes looking
|
|
|
|
* for the '=' char */
|
|
|
|
// putenv((char*)"DESKTOP_STARTUP_ID=");
|
2005-09-13 20:26:23 -07:00
|
|
|
}
|
2003-09-23 01:09:32 -07:00
|
|
|
|
2012-02-27 22:43:59 -08:00
|
|
|
_ecore_evas_x_hints_update(ee);
|
2010-10-01 18:56:23 -07:00
|
|
|
_ecore_evas_x_group_leader_set(ee);
|
|
|
|
ecore_x_window_defaults_set(ee->prop.window);
|
|
|
|
_ecore_evas_x_protocols_set(ee);
|
2012-12-04 22:48:46 -08:00
|
|
|
_ecore_evas_x_window_profile_protocol_set(ee);
|
2014-02-08 16:46:51 -08:00
|
|
|
_ecore_evas_x_wm_rotation_protocol_set(ee);
|
2014-02-27 14:20:01 -08:00
|
|
|
_ecore_evas_x_aux_hints_supprted_update(ee);
|
|
|
|
_ecore_evas_x_aux_hints_update(ee);
|
2010-10-01 18:56:23 -07:00
|
|
|
_ecore_evas_x_sync_set(ee);
|
|
|
|
|
2010-01-06 21:29:06 -08:00
|
|
|
ee->engine.func->fn_render = _ecore_evas_x_render;
|
|
|
|
_ecore_evas_register(ee);
|
2015-02-04 01:58:48 -08:00
|
|
|
ecore_x_input_multi_select(ee->prop.window);
|
2010-12-07 19:25:23 -08:00
|
|
|
ecore_event_window_register(ee->prop.window, ee, ee->evas,
|
|
|
|
(Ecore_Event_Mouse_Move_Cb)_ecore_evas_mouse_move_process,
|
|
|
|
(Ecore_Event_Multi_Move_Cb)_ecore_evas_mouse_multi_move_process,
|
|
|
|
(Ecore_Event_Multi_Down_Cb)_ecore_evas_mouse_multi_down_process,
|
|
|
|
(Ecore_Event_Multi_Up_Cb)_ecore_evas_mouse_multi_up_process);
|
Here is ecore_x with XCB backend.
* The XCB backend is disabled by default during the
configuration. To enable it, add --enable-ecore-x-xcb. See the
messages that configure displays when it finishes.
* The way XCB is detected, and used in src/lib/ecore_x/Makefile.am
should be improved
* Any program that uses ecore_evas does not need to be modified.
Any program that uses ecore_x may need some changes. That is,
adding some functions (_prefetch and _fetch ones). No other
change is needed. See the documention of any _get functions, as
these are the ones that need those functions.
* There are some missing parts, especially everything that involves
the keyboard, as porting Xlib functions related to strings (utf8
stuff, XKeysymToString, etc...) is an horror. So keyboard events
are not working yet.
* I tried to write as much documentation as I could. But there is
certainly some missing doc here and there.
there are certainly other things that I have forgotten.
Improvements of that backend:
* the creation of an ecore_evas is faster. Especially when done over
an ssh connection (on my computer, 7-10s with Xlib, 1.5s with XCB,
over an ssh)
* A Window Manager should be more responsive. But it's not tomorrow
that e17 will use it :)
Have fun !
SVN revision: 29500
2007-04-13 10:15:19 -07:00
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
return ee;
|
2009-04-11 03:31:42 -07:00
|
|
|
}
|
2012-12-05 13:15:42 -08:00
|
|
|
|
2010-03-01 17:43:45 -08:00
|
|
|
EAPI Ecore_Evas *
|
2012-12-05 13:15:42 -08:00
|
|
|
ecore_evas_gl_x11_new_internal(const char *disp_name, Ecore_X_Window parent,
|
|
|
|
int x, int y, int w, int h)
|
2010-03-01 17:43:45 -08:00
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
return ecore_evas_gl_x11_options_new_internal(disp_name, parent, x, y, w, h, NULL);
|
2010-03-01 17:43:45 -08:00
|
|
|
}
|
2004-08-27 02:37:14 -07:00
|
|
|
|
2013-07-07 23:21:14 -07:00
|
|
|
EAPI Ecore_Evas *
|
|
|
|
ecore_evas_gl_x11_pixmap_new_internal(const char *disp_name, Ecore_X_Window parent,
|
|
|
|
int x, int y, int w, int h)
|
|
|
|
{
|
|
|
|
Ecore_Evas *ee;
|
|
|
|
Ecore_Evas_Engine_Data_X11 *edata;
|
|
|
|
Ecore_Evas_Interface_X11 *iface;
|
|
|
|
Ecore_Evas_Interface_Gl_X11 *giface;
|
|
|
|
Evas_Engine_Info_GL_X11 *einfo;
|
|
|
|
int rmethod, argb = 0;
|
|
|
|
static int redraw_debug = -1;
|
|
|
|
|
|
|
|
rmethod = evas_render_method_lookup("gl_x11");
|
|
|
|
if (!rmethod) return NULL;
|
|
|
|
if (!ecore_x_init(disp_name)) return NULL;
|
|
|
|
ee = calloc(1, sizeof(Ecore_Evas));
|
|
|
|
if (!ee) return NULL;
|
|
|
|
edata = calloc(1, sizeof(Ecore_Evas_Engine_Data_X11));
|
|
|
|
if (!edata)
|
|
|
|
{
|
|
|
|
free(ee);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
iface = _ecore_evas_x_interface_x11_new();
|
|
|
|
giface = _ecore_evas_x_interface_gl_x11_new();
|
|
|
|
|
|
|
|
ee->engine.ifaces = eina_list_append(ee->engine.ifaces, iface);
|
|
|
|
ee->engine.ifaces = eina_list_append(ee->engine.ifaces, giface);
|
|
|
|
|
|
|
|
ee->engine.data = edata;
|
|
|
|
|
|
|
|
ECORE_MAGIC_SET(ee, ECORE_MAGIC_EVAS);
|
|
|
|
|
2013-12-18 06:47:29 -08:00
|
|
|
ee->gl_sync_draw_done = -1;
|
2013-07-07 23:21:14 -07:00
|
|
|
|
|
|
|
_ecore_evas_x_init();
|
|
|
|
|
|
|
|
ee->engine.func = (Ecore_Evas_Engine_Func *)&_ecore_x_engine_func;
|
|
|
|
|
|
|
|
ee->driver = "opengl_x11";
|
|
|
|
#if 1
|
|
|
|
ee->semi_sync = 0; // gl engine doesn't need to sync - its whole swaps
|
|
|
|
#else
|
|
|
|
if (!getenv("ECORE_EVAS_COMP_NOSEMISYNC"))
|
|
|
|
ee->semi_sync = 1; // gl engine doesn't need to sync - its whole swaps
|
|
|
|
// ee->no_comp_sync = 1; // gl engine doesn't need to sync - its whole swaps
|
|
|
|
#endif
|
|
|
|
if (disp_name) ee->name = strdup(disp_name);
|
|
|
|
|
|
|
|
if (w < 1) w = 1;
|
|
|
|
if (h < 1) h = 1;
|
|
|
|
ee->x = x;
|
|
|
|
ee->y = y;
|
|
|
|
ee->w = w;
|
|
|
|
ee->h = h;
|
|
|
|
ee->req.x = ee->x;
|
|
|
|
ee->req.y = ee->y;
|
|
|
|
ee->req.w = ee->w;
|
|
|
|
ee->req.h = ee->h;
|
|
|
|
|
|
|
|
ee->prop.max.w = 32767;
|
|
|
|
ee->prop.max.h = 32767;
|
|
|
|
ee->prop.layer = 4;
|
2014-01-12 21:26:36 -08:00
|
|
|
ee->prop.request_pos = EINA_FALSE;
|
2013-07-07 23:21:14 -07:00
|
|
|
ee->prop.sticky = 0;
|
|
|
|
edata->state.sticky = 0;
|
|
|
|
|
|
|
|
/* init evas here */
|
|
|
|
ee->evas = evas_new();
|
|
|
|
evas_event_callback_add(ee->evas, EVAS_CALLBACK_RENDER_FLUSH_PRE,
|
|
|
|
_ecore_evas_x_flush_pre, ee);
|
|
|
|
evas_event_callback_add(ee->evas, EVAS_CALLBACK_RENDER_FLUSH_POST,
|
|
|
|
_ecore_evas_x_flush_post, ee);
|
|
|
|
evas_event_callback_add(ee->evas, EVAS_CALLBACK_RENDER_PRE,
|
|
|
|
_ecore_evas_x_render_pre, ee);
|
|
|
|
evas_data_attach_set(ee->evas, ee);
|
|
|
|
evas_output_method_set(ee->evas, rmethod);
|
|
|
|
evas_output_size_set(ee->evas, w, h);
|
|
|
|
evas_output_viewport_set(ee->evas, 0, 0, w, h);
|
|
|
|
|
|
|
|
if (ee->can_async_render)
|
|
|
|
evas_event_callback_add(ee->evas, EVAS_CALLBACK_RENDER_POST,
|
|
|
|
_ecore_evas_x_render_updates, ee);
|
|
|
|
|
|
|
|
if (parent == 0) parent = ecore_x_window_root_first_get();
|
|
|
|
edata->win_root = parent;
|
|
|
|
|
|
|
|
if (parent != 0)
|
|
|
|
{
|
|
|
|
edata->screen_num = 1; /* FIXME: get real scren # */
|
|
|
|
/* FIXME: round trip in ecore_x_window_argb_get */
|
|
|
|
if (ecore_x_window_argb_get(parent))
|
|
|
|
argb = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
edata->direct_resize = 1;
|
|
|
|
|
|
|
|
einfo = (Evas_Engine_Info_GL_X11 *)evas_engine_info_get(ee->evas);
|
|
|
|
if (einfo)
|
|
|
|
{
|
|
|
|
int screen = 0;
|
|
|
|
|
|
|
|
/* FIXME: this is inefficient as its 1 or more round trips */
|
|
|
|
screen = ecore_x_screen_index_get(ecore_x_default_screen_get());
|
|
|
|
if (ecore_x_screen_count_get() > 1)
|
|
|
|
{
|
|
|
|
Ecore_X_Window *roots;
|
|
|
|
int num, i;
|
|
|
|
|
|
|
|
num = 0;
|
|
|
|
roots = ecore_x_window_root_list(&num);
|
|
|
|
if (roots)
|
|
|
|
{
|
|
|
|
Ecore_X_Window root;
|
|
|
|
|
|
|
|
root = ecore_x_window_root_get(parent);
|
|
|
|
for (i = 0; i < num; i++)
|
|
|
|
{
|
|
|
|
if (root == roots[i])
|
|
|
|
{
|
|
|
|
screen = i;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
free(roots);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
einfo->info.display = ecore_x_display_get();
|
|
|
|
einfo->info.screen = screen;
|
|
|
|
|
|
|
|
einfo->info.destination_alpha = argb;
|
|
|
|
|
|
|
|
einfo->info.visual = einfo->func.best_visual_get(einfo);
|
|
|
|
einfo->info.colormap = einfo->func.best_colormap_get(einfo);
|
|
|
|
einfo->info.depth = einfo->func.best_depth_get(einfo);
|
|
|
|
|
|
|
|
if (redraw_debug < 0)
|
|
|
|
{
|
|
|
|
if (getenv("REDRAW_DEBUG"))
|
|
|
|
redraw_debug = atoi(getenv("REDRAW_DEBUG"));
|
|
|
|
else
|
|
|
|
redraw_debug = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
einfo->info.rotation = 0;
|
|
|
|
|
|
|
|
/* record pixmap size to save X roundtrips */
|
|
|
|
edata->pixmap.w = w;
|
|
|
|
edata->pixmap.h = h;
|
|
|
|
edata->pixmap.depth = einfo->info.depth;
|
2013-07-11 02:47:08 -07:00
|
|
|
edata->pixmap.visual = einfo->info.visual;
|
|
|
|
edata->pixmap.colormap = einfo->info.colormap;
|
2013-07-07 23:21:14 -07:00
|
|
|
|
|
|
|
/* create front and back pixmaps for double-buffer rendering */
|
|
|
|
edata->pixmap.front =
|
|
|
|
ecore_x_pixmap_new(parent, w, h, edata->pixmap.depth);
|
|
|
|
edata->pixmap.back =
|
|
|
|
ecore_x_pixmap_new(parent, w, h, edata->pixmap.depth);
|
|
|
|
|
|
|
|
einfo->info.drawable = edata->pixmap.back;
|
|
|
|
|
|
|
|
if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
|
|
|
|
{
|
2014-09-30 09:19:15 -07:00
|
|
|
ERR("evas_engine_info_set() init engine '%s' failed.", ee->driver);
|
2013-07-07 23:21:14 -07:00
|
|
|
ecore_evas_free(ee);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* _ecore_evas_x_hints_update(ee); */
|
|
|
|
/* _ecore_evas_x_group_leader_set(ee); */
|
|
|
|
/* ecore_x_window_defaults_set(ee->prop.window); */
|
|
|
|
/* _ecore_evas_x_protocols_set(ee); */
|
|
|
|
/* _ecore_evas_x_window_profile_protocol_set(ee); */
|
|
|
|
/* _ecore_evas_x_sync_set(ee); */
|
|
|
|
|
|
|
|
ee->engine.func->fn_render = _ecore_evas_x_render;
|
|
|
|
_ecore_evas_register(ee);
|
|
|
|
|
2015-02-04 01:58:48 -08:00
|
|
|
/* ecore_x_input_multi_select(ee->prop.window); */
|
2013-07-07 23:21:14 -07:00
|
|
|
/* ecore_event_window_register(ee->prop.window, ee, ee->evas, */
|
|
|
|
/* (Ecore_Event_Mouse_Move_Cb)_ecore_evas_mouse_move_process, */
|
|
|
|
/* (Ecore_Event_Multi_Move_Cb)_ecore_evas_mouse_multi_move_process, */
|
|
|
|
/* (Ecore_Event_Multi_Down_Cb)_ecore_evas_mouse_multi_down_process, */
|
|
|
|
/* (Ecore_Event_Multi_Up_Cb)_ecore_evas_mouse_multi_up_process); */
|
|
|
|
|
|
|
|
return ee;
|
|
|
|
}
|
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
static Ecore_X_Window
|
|
|
|
_ecore_evas_gl_x11_window_get(const Ecore_Evas *ee)
|
2004-08-27 02:37:14 -07:00
|
|
|
{
|
2012-05-28 05:24:30 -07:00
|
|
|
if (!(!strcmp(ee->driver, "opengl_x11"))) return 0;
|
2009-03-16 09:24:43 -07:00
|
|
|
return (Ecore_X_Window) ecore_evas_window_get(ee);
|
2009-04-11 03:31:42 -07:00
|
|
|
}
|
2004-11-23 07:17:56 -08:00
|
|
|
|
2013-07-07 23:21:14 -07:00
|
|
|
static Ecore_X_Pixmap
|
|
|
|
_ecore_evas_gl_x11_pixmap_get(const Ecore_Evas *ee)
|
|
|
|
{
|
|
|
|
if (!(!strcmp(ee->driver, "opengl_x11"))) return 0;
|
|
|
|
Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
|
|
|
|
return (Ecore_X_Pixmap) edata->pixmap.front;
|
|
|
|
}
|
|
|
|
|
2013-07-11 02:47:08 -07:00
|
|
|
static void *
|
|
|
|
_ecore_evas_gl_x11_pixmap_visual_get(const Ecore_Evas *ee)
|
|
|
|
{
|
|
|
|
if (!(!strcmp(ee->driver, "opengl_x11"))) return 0;
|
|
|
|
Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
|
|
|
|
return edata->pixmap.visual;
|
|
|
|
}
|
|
|
|
|
|
|
|
static unsigned long
|
|
|
|
_ecore_evas_gl_x11_pixmap_colormap_get(const Ecore_Evas *ee)
|
|
|
|
{
|
|
|
|
if (!(!strcmp(ee->driver, "opengl_x11"))) return 0;
|
|
|
|
Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
|
|
|
|
return edata->pixmap.colormap;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
_ecore_evas_gl_x11_pixmap_depth_get(const Ecore_Evas *ee)
|
|
|
|
{
|
|
|
|
if (!(!strcmp(ee->driver, "opengl_x11"))) return 0;
|
|
|
|
Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
|
|
|
|
return edata->pixmap.depth;
|
|
|
|
}
|
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
static void
|
|
|
|
_ecore_evas_gl_x11_direct_resize_set(Ecore_Evas *ee, Eina_Bool on)
|
2009-04-11 03:31:42 -07:00
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
|
|
|
|
edata->direct_resize = on;
|
2004-11-23 07:17:56 -08:00
|
|
|
}
|
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
static Eina_Bool
|
|
|
|
_ecore_evas_gl_x11_direct_resize_get(const Ecore_Evas *ee)
|
2009-04-11 03:31:42 -07:00
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
|
|
|
|
|
|
|
|
return edata->direct_resize;
|
2004-11-23 07:17:56 -08:00
|
|
|
}
|
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
static void
|
|
|
|
_ecore_evas_gl_x11_extra_event_window_add(Ecore_Evas *ee, Ecore_X_Window win)
|
2005-09-24 02:00:23 -07:00
|
|
|
{
|
|
|
|
ecore_evas_software_x11_extra_event_window_add(ee, win);
|
|
|
|
}
|
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
static void
|
|
|
|
_ecore_evas_gl_x11_pre_post_swap_callback_set(const Ecore_Evas *ee, void *data, void (*pre_cb) (void *data, Evas *e), void (*post_cb) (void *data, Evas *e))
|
2010-01-24 03:01:39 -08:00
|
|
|
{
|
|
|
|
Evas_Engine_Info_GL_X11 *einfo;
|
2011-04-20 07:15:33 -07:00
|
|
|
|
2010-01-24 03:01:39 -08:00
|
|
|
if (!(!strcmp(ee->driver, "opengl_x11"))) return;
|
2011-04-20 07:15:33 -07:00
|
|
|
|
2010-01-24 03:01:39 -08:00
|
|
|
einfo = (Evas_Engine_Info_GL_X11 *)evas_engine_info_get(ee->evas);
|
|
|
|
if (einfo)
|
|
|
|
{
|
|
|
|
einfo->callback.pre_swap = pre_cb;
|
2011-08-25 01:14:21 -07:00
|
|
|
einfo->callback.post_swap = post_cb;
|
2010-01-24 03:01:39 -08:00
|
|
|
einfo->callback.data = data;
|
2010-09-29 10:03:38 -07:00
|
|
|
if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
|
2010-05-17 20:50:17 -07:00
|
|
|
{
|
|
|
|
ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
|
|
|
|
}
|
2010-01-24 03:01:39 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif /* ! BUILD_ECORE_EVAS_OPENGL_X11 */
|
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
static void
|
|
|
|
_ecore_evas_x11_leader_set(Ecore_Evas *ee, Ecore_X_Window win)
|
2010-10-01 18:56:23 -07:00
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
|
|
|
|
|
2010-10-01 18:56:23 -07:00
|
|
|
_ecore_evas_x_group_leader_unset(ee);
|
2012-12-05 13:15:42 -08:00
|
|
|
edata->leader = win;
|
2010-10-01 18:56:23 -07:00
|
|
|
_ecore_evas_x_group_leader_update(ee);
|
|
|
|
}
|
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
static Ecore_X_Window
|
|
|
|
_ecore_evas_x11_leader_get(Ecore_Evas *ee)
|
2010-10-01 18:56:23 -07:00
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Engine_Data_X11 *edata = ee->engine.data;
|
|
|
|
|
|
|
|
return edata->leader;
|
2010-10-01 18:56:23 -07:00
|
|
|
}
|
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
static void
|
|
|
|
_ecore_evas_x11_leader_default_set(Ecore_Evas *ee)
|
2010-10-01 18:56:23 -07:00
|
|
|
{
|
|
|
|
_ecore_evas_x_group_leader_unset(ee);
|
|
|
|
_ecore_evas_x_group_leader_set(ee);
|
|
|
|
}
|
|
|
|
|
2011-04-13 02:06:05 -07:00
|
|
|
static Eina_Bool
|
|
|
|
_ecore_evas_x11_convert_rectangle_with_angle(Ecore_Evas *ee, Ecore_X_Rectangle *dst_rect, Ecore_X_Rectangle *src_rect)
|
|
|
|
{
|
2011-07-14 08:40:53 -07:00
|
|
|
if ((!src_rect) || (!dst_rect)) return 0;
|
2011-04-13 02:06:05 -07:00
|
|
|
|
|
|
|
if (ee->rotation == 0)
|
|
|
|
{
|
|
|
|
dst_rect->x = src_rect->x;
|
|
|
|
dst_rect->y = src_rect->y;
|
|
|
|
dst_rect->width = src_rect->width;
|
|
|
|
dst_rect->height = src_rect->height;
|
|
|
|
}
|
|
|
|
else if (ee->rotation == 90)
|
|
|
|
{
|
|
|
|
dst_rect->x = src_rect->y;
|
|
|
|
dst_rect->y = ee->req.h - src_rect->x - src_rect->width;
|
|
|
|
dst_rect->width = src_rect->height;
|
|
|
|
dst_rect->height = src_rect->width;
|
|
|
|
}
|
|
|
|
else if (ee->rotation == 180)
|
|
|
|
{
|
|
|
|
dst_rect->x = ee->req.w - src_rect->x - src_rect->width;
|
|
|
|
dst_rect->y = ee->req.h - src_rect->y - src_rect->height;
|
|
|
|
dst_rect->width = src_rect->width;
|
|
|
|
dst_rect->height = src_rect->height;
|
|
|
|
}
|
|
|
|
else if (ee->rotation == 270)
|
|
|
|
{
|
|
|
|
dst_rect->x = ee->req.w - src_rect->y - src_rect->height;
|
|
|
|
dst_rect->y = src_rect->x;
|
|
|
|
dst_rect->width = src_rect->height;
|
|
|
|
dst_rect->height = src_rect->width;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
static void
|
|
|
|
_ecore_evas_x11_shape_input_rectangle_set(Ecore_Evas *ee, int x, int y, int w, int h)
|
2011-04-13 02:06:05 -07:00
|
|
|
{
|
|
|
|
Eina_Bool ret;
|
|
|
|
Ecore_X_Rectangle src_rect;
|
|
|
|
Ecore_X_Rectangle dst_rect;
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Engine_Data_X11 *edata;
|
2011-04-13 02:06:05 -07:00
|
|
|
|
|
|
|
if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
|
|
|
|
{
|
|
|
|
ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
|
|
|
|
"ecore_evas_x11_shape_input_rectangle_set");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
edata = ee->engine.data;
|
2011-04-13 02:06:05 -07:00
|
|
|
src_rect.x = x;
|
|
|
|
src_rect.y = y;
|
|
|
|
src_rect.width = w;
|
|
|
|
src_rect.height = h;
|
|
|
|
|
2011-07-14 08:40:53 -07:00
|
|
|
dst_rect.x = 0;
|
|
|
|
dst_rect.y = 0;
|
|
|
|
dst_rect.width = 0;
|
|
|
|
dst_rect.height = 0;
|
|
|
|
|
2011-04-13 02:06:05 -07:00
|
|
|
ret = _ecore_evas_x11_convert_rectangle_with_angle(ee, &dst_rect, &src_rect);
|
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
if (!edata->win_shaped_input)
|
|
|
|
edata->win_shaped_input = ecore_x_window_override_new(edata->win_root,
|
2011-07-14 08:40:53 -07:00
|
|
|
0, 0, 1, 1);
|
2011-04-13 02:06:05 -07:00
|
|
|
|
|
|
|
if (ret)
|
2012-12-05 13:15:42 -08:00
|
|
|
ecore_x_window_shape_input_rectangle_set(edata->win_shaped_input,
|
2011-09-21 23:02:26 -07:00
|
|
|
dst_rect.x, dst_rect.y,
|
2011-07-14 08:40:53 -07:00
|
|
|
dst_rect.width, dst_rect.height);
|
2011-04-13 02:06:05 -07:00
|
|
|
}
|
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
static void
|
|
|
|
_ecore_evas_x11_shape_input_rectangle_add(Ecore_Evas *ee, int x, int y, int w, int h)
|
2011-04-13 02:06:05 -07:00
|
|
|
{
|
|
|
|
Eina_Bool ret;
|
|
|
|
Ecore_X_Rectangle src_rect;
|
|
|
|
Ecore_X_Rectangle dst_rect;
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Engine_Data_X11 *edata;
|
2011-04-13 02:06:05 -07:00
|
|
|
|
|
|
|
if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
|
|
|
|
{
|
|
|
|
ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
|
|
|
|
"ecore_evas_x11_shape_input_rectangle_add");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
edata = ee->engine.data;
|
2011-04-13 02:06:05 -07:00
|
|
|
src_rect.x = x;
|
|
|
|
src_rect.y = y;
|
|
|
|
src_rect.width = w;
|
|
|
|
src_rect.height = h;
|
|
|
|
|
2011-07-14 08:40:53 -07:00
|
|
|
dst_rect.x = 0;
|
|
|
|
dst_rect.y = 0;
|
|
|
|
dst_rect.width = 0;
|
|
|
|
dst_rect.height = 0;
|
|
|
|
|
2011-04-13 02:06:05 -07:00
|
|
|
ret = _ecore_evas_x11_convert_rectangle_with_angle(ee, &dst_rect, &src_rect);
|
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
if (!edata->win_shaped_input)
|
|
|
|
edata->win_shaped_input = ecore_x_window_override_new(edata->win_root,
|
2011-07-14 08:40:53 -07:00
|
|
|
0, 0, 1, 1);
|
2011-04-13 02:06:05 -07:00
|
|
|
|
|
|
|
if (ret)
|
2012-12-05 13:15:42 -08:00
|
|
|
ecore_x_window_shape_input_rectangle_add(edata->win_shaped_input,
|
2011-09-21 23:02:26 -07:00
|
|
|
dst_rect.x, dst_rect.y,
|
2011-07-14 08:40:53 -07:00
|
|
|
dst_rect.width, dst_rect.height);
|
2011-04-13 02:06:05 -07:00
|
|
|
}
|
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
static void
|
|
|
|
_ecore_evas_x11_shape_input_rectangle_subtract(Ecore_Evas *ee, int x, int y, int w, int h)
|
2011-04-13 02:06:05 -07:00
|
|
|
{
|
|
|
|
Eina_Bool ret;
|
|
|
|
Ecore_X_Rectangle src_rect;
|
|
|
|
Ecore_X_Rectangle dst_rect;
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Engine_Data_X11 *edata;
|
2011-04-13 02:06:05 -07:00
|
|
|
|
|
|
|
if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
|
|
|
|
{
|
|
|
|
ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
|
|
|
|
"ecore_evas_x11_shape_input_rectangle_subtract");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
edata = ee->engine.data;
|
2011-04-13 02:06:05 -07:00
|
|
|
src_rect.x = x;
|
|
|
|
src_rect.y = y;
|
|
|
|
src_rect.width = w;
|
|
|
|
src_rect.height = h;
|
|
|
|
|
2011-07-14 08:40:53 -07:00
|
|
|
dst_rect.x = 0;
|
|
|
|
dst_rect.y = 0;
|
|
|
|
dst_rect.width = 0;
|
|
|
|
dst_rect.height = 0;
|
|
|
|
|
2011-04-13 02:06:05 -07:00
|
|
|
ret = _ecore_evas_x11_convert_rectangle_with_angle(ee, &dst_rect, &src_rect);
|
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
if (!edata->win_shaped_input)
|
|
|
|
edata->win_shaped_input = ecore_x_window_override_new(edata->win_root,
|
2011-07-14 08:40:53 -07:00
|
|
|
0, 0, 1, 1);
|
2011-04-13 02:06:05 -07:00
|
|
|
|
|
|
|
if (ret)
|
2012-12-05 13:15:42 -08:00
|
|
|
ecore_x_window_shape_input_rectangle_subtract(edata->win_shaped_input,
|
2011-09-21 23:02:26 -07:00
|
|
|
dst_rect.x, dst_rect.y,
|
2011-07-14 08:40:53 -07:00
|
|
|
dst_rect.width, dst_rect.height);
|
2011-04-13 02:06:05 -07:00
|
|
|
}
|
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
static void
|
|
|
|
_ecore_evas_x11_shape_input_empty(Ecore_Evas *ee)
|
2011-04-13 02:06:05 -07:00
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Engine_Data_X11 *edata;
|
2011-04-13 02:06:05 -07:00
|
|
|
if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
|
|
|
|
{
|
|
|
|
ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
|
|
|
|
"ecore_evas_x11_shape_input_empty");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
edata = ee->engine.data;
|
|
|
|
if (!edata->win_shaped_input)
|
|
|
|
edata->win_shaped_input = ecore_x_window_override_new(edata->win_root, 0, 0, 1, 1);
|
2011-04-13 02:06:05 -07:00
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
ecore_x_window_shape_input_rectangle_set(edata->win_shaped_input, 0, 0, 0, 0);
|
2011-04-13 02:06:05 -07:00
|
|
|
}
|
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
static void
|
|
|
|
_ecore_evas_x11_shape_input_reset(Ecore_Evas *ee)
|
2011-04-13 02:06:05 -07:00
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Engine_Data_X11 *edata;
|
2011-04-13 02:06:05 -07:00
|
|
|
if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
|
|
|
|
{
|
|
|
|
ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
|
|
|
|
"ecore_evas_x11_shape_input_reset");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
edata = ee->engine.data;
|
|
|
|
if (!edata->win_shaped_input)
|
|
|
|
edata->win_shaped_input = ecore_x_window_override_new(edata->win_root, 0, 0, 1, 1);
|
2011-04-13 02:06:05 -07:00
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
ecore_x_window_shape_input_rectangle_set(edata->win_shaped_input, 0, 0, 65535, 65535);
|
2011-04-13 02:06:05 -07:00
|
|
|
}
|
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
static void
|
|
|
|
_ecore_evas_x11_shape_input_apply(Ecore_Evas *ee)
|
2011-04-13 02:06:05 -07:00
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Engine_Data_X11 *edata;
|
2011-04-13 02:06:05 -07:00
|
|
|
if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
|
|
|
|
{
|
|
|
|
ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
|
|
|
|
"ecore_evas_x11_shape_input_apply");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
edata = ee->engine.data;
|
|
|
|
if (!edata->win_shaped_input) return;
|
2011-04-13 02:06:05 -07:00
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
ecore_x_window_shape_input_window_set(ee->prop.window, edata->win_shaped_input);
|
|
|
|
}
|
|
|
|
|
|
|
|
static Ecore_Evas_Interface_X11 *
|
|
|
|
_ecore_evas_x_interface_x11_new(void)
|
|
|
|
{
|
|
|
|
Ecore_Evas_Interface_X11 *iface;
|
|
|
|
|
|
|
|
iface = calloc(1, sizeof(Ecore_Evas_Interface_X11));
|
|
|
|
if (!iface) return NULL;
|
|
|
|
|
|
|
|
iface->base.name = interface_x11_name;
|
|
|
|
iface->base.version = interface_x11_version;
|
|
|
|
|
|
|
|
iface->leader_set = _ecore_evas_x11_leader_set;
|
|
|
|
iface->leader_get = _ecore_evas_x11_leader_get;
|
|
|
|
iface->leader_default_set = _ecore_evas_x11_leader_default_set;
|
|
|
|
iface->shape_input_rectangle_set = _ecore_evas_x11_shape_input_rectangle_set;
|
|
|
|
iface->shape_input_rectangle_add = _ecore_evas_x11_shape_input_rectangle_add;
|
|
|
|
iface->shape_input_rectangle_subtract = _ecore_evas_x11_shape_input_rectangle_subtract;
|
|
|
|
iface->shape_input_empty = _ecore_evas_x11_shape_input_empty;
|
|
|
|
iface->shape_input_reset = _ecore_evas_x11_shape_input_reset;
|
|
|
|
iface->shape_input_reset = _ecore_evas_x11_shape_input_apply;
|
|
|
|
|
|
|
|
return iface;
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef BUILD_ECORE_EVAS_SOFTWARE_X11
|
|
|
|
static Ecore_Evas_Interface_Software_X11 *
|
|
|
|
_ecore_evas_x_interface_software_x11_new(void)
|
|
|
|
{
|
|
|
|
Ecore_Evas_Interface_Software_X11 *iface;
|
|
|
|
|
|
|
|
iface = calloc(1, sizeof(Ecore_Evas_Interface_Software_X11));
|
|
|
|
if (!iface) return NULL;
|
|
|
|
|
|
|
|
iface->base.name = interface_software_x11_name;
|
|
|
|
iface->base.version = interface_software_x11_version;
|
|
|
|
|
|
|
|
iface->window_get = _ecore_evas_software_x11_window_get;
|
2013-07-05 02:38:43 -07:00
|
|
|
iface->pixmap_get = _ecore_evas_software_x11_pixmap_get;
|
2012-12-05 13:15:42 -08:00
|
|
|
iface->resize_set = _ecore_evas_software_x11_direct_resize_set;
|
|
|
|
iface->resize_get = _ecore_evas_software_x11_direct_resize_get;
|
|
|
|
iface->extra_event_window_add = _ecore_evas_software_x11_extra_event_window_add;
|
2013-07-11 02:47:08 -07:00
|
|
|
iface->pixmap_visual_get = _ecore_evas_software_x11_pixmap_visual_get;
|
|
|
|
iface->pixmap_colormap_get = _ecore_evas_software_x11_pixmap_colormap_get;
|
|
|
|
iface->pixmap_depth_get = _ecore_evas_software_x11_pixmap_depth_get;
|
2012-12-05 13:15:42 -08:00
|
|
|
|
|
|
|
return iface;
|
|
|
|
}
|
2011-04-13 02:06:05 -07:00
|
|
|
#endif
|
2012-12-05 13:15:42 -08:00
|
|
|
|
|
|
|
#ifdef BUILD_ECORE_EVAS_OPENGL_X11
|
|
|
|
static Ecore_Evas_Interface_Gl_X11 *
|
|
|
|
_ecore_evas_x_interface_gl_x11_new(void)
|
|
|
|
{
|
|
|
|
Ecore_Evas_Interface_Gl_X11 *iface;
|
|
|
|
|
|
|
|
iface = calloc(1, sizeof(Ecore_Evas_Interface_Gl_X11));
|
|
|
|
if (!iface) return NULL;
|
|
|
|
|
|
|
|
iface->base.name = interface_gl_x11_name;
|
|
|
|
iface->base.version = interface_gl_x11_version;
|
|
|
|
|
|
|
|
iface->window_get = _ecore_evas_gl_x11_window_get;
|
2013-07-07 23:21:14 -07:00
|
|
|
iface->pixmap_get = _ecore_evas_gl_x11_pixmap_get;
|
2012-12-05 13:15:42 -08:00
|
|
|
iface->resize_set = _ecore_evas_gl_x11_direct_resize_set;
|
|
|
|
iface->resize_get = _ecore_evas_gl_x11_direct_resize_get;
|
2013-01-05 06:04:22 -08:00
|
|
|
iface->extra_event_window_add = _ecore_evas_gl_x11_extra_event_window_add;
|
2012-12-05 13:15:42 -08:00
|
|
|
iface->pre_post_swap_callback_set = _ecore_evas_gl_x11_pre_post_swap_callback_set;
|
2013-07-11 02:47:08 -07:00
|
|
|
iface->pixmap_visual_get = _ecore_evas_gl_x11_pixmap_visual_get;
|
|
|
|
iface->pixmap_colormap_get = _ecore_evas_gl_x11_pixmap_colormap_get;
|
|
|
|
iface->pixmap_depth_get = _ecore_evas_gl_x11_pixmap_depth_get;
|
2012-12-05 13:15:42 -08:00
|
|
|
|
|
|
|
return iface;
|
2011-04-13 02:06:05 -07:00
|
|
|
}
|
2012-12-05 13:15:42 -08:00
|
|
|
#endif
|