static int _ecore_xcb_cursor_size = 0;
static Eina_Bool _ecore_xcb_cursor = EINA_FALSE;
#ifdef ECORE_XCB_CURSOR
-static xcb_render_pictforminfo_t *_ecore_xcb_cursor_format = NULL;
+static uint32_t _ecore_xcb_cursor_format_id = 0;
+// static xcb_render_pictforminfo_t *_ecore_xcb_cursor_format = NULL;
#endif
void
_ecore_xcb_cursor = _ecore_xcb_render_argb_get();
/* find render pict format */
- _ecore_xcb_cursor_format = _ecore_xcb_cursor_format_get();
+ if (_ecore_xcb_cursor_format_id <= 0)
+ _ecore_xcb_cursor_format_id = _ecore_xcb_cursor_format_get()->id;
#endif
/* try to grab cursor size from XDefaults */
pict = xcb_generate_id(_ecore_xcb_conn);
xcb_render_create_picture(_ecore_xcb_conn, pict, pmap,
- _ecore_xcb_cursor_format->id, 0, NULL);
+ _ecore_xcb_cursor_format_id, 0, NULL);
xcb_free_pixmap(_ecore_xcb_conn, pmap);
cursor = xcb_generate_id(_ecore_xcb_conn);
LOGFN(__FILE__, __LINE__, __FUNCTION__);
+ if (!_damage_avail) return 0;
+
#ifdef ECORE_XCB_DAMAGE
damage = xcb_generate_id(_ecore_xcb_conn);
xcb_damage_create(_ecore_xcb_conn, damage, drawable, level);
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
+ if (!_damage_avail) return;
+
#ifdef ECORE_XCB_DAMAGE
xcb_damage_destroy(_ecore_xcb_conn, damage);
// ecore_x_flush();
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
+ if (!_damage_avail) return;
+
#ifdef ECORE_XCB_DAMAGE
xcb_damage_subtract(_ecore_xcb_conn, damage, repair, parts);
// ecore_x_flush();
if (_target->state == ECORE_X_DND_TARGET_IDLE) return;
- DBG("Ecore_X_Dnd_Send_Status");
memset(&ev, 0, sizeof(xcb_client_message_event_t));
_target->will_accept = will_accept;
memset(&ev, 0, sizeof(xcb_client_message_event_t));
- DBG("Ecore_X_Dnd_Drop");
if (_source->dest)
{
ev.response_type = XCB_CLIENT_MESSAGE;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- DBG("Ecore_X_Dnd_Aware_Set");
if (on)
ecore_x_window_prop_property_set(win, ECORE_X_ATOM_XDND_AWARE,
ECORE_X_ATOM_ATOM, 32, &prop_data, 1);
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- DBG("Ecore_X_Dnd_Type_Set");
atom = ecore_x_atom_get(type);
ecore_x_window_prop_property_get(win, ECORE_X_ATOM_XDND_TYPE_LIST,
ECORE_X_ATOM_ATOM, 32, &old_data, &num);
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- DBG("Ecore_X_Dnd_Types_Set");
if (!num_types)
ecore_x_window_prop_property_del(win, ECORE_X_ATOM_XDND_TYPE_LIST);
else
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- DBG("Ecore_X_Dnd_Actions_Set");
if (!num_actions)
ecore_x_window_prop_property_del(win, ECORE_X_ATOM_XDND_ACTION_LIST);
else
if (!ecore_x_dnd_version_get(source)) return EINA_FALSE;
- DBG("Ecore_X_Dnd_Begin");
/* Take ownership of XdndSelection */
if (!ecore_x_selection_xdnd_set(source, data, size)) return EINA_FALSE;
if (_target->state == ECORE_X_DND_TARGET_IDLE) return;
- DBG("Ecore_X_Dnd_Send_Finished");
memset(&ev, 0, sizeof(xcb_client_message_event_t));
ev.response_type = XCB_CLIENT_MESSAGE;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- DBG("Ecore_X_Dnd_Drag");
memset(&ev, 0, sizeof(xcb_client_message_event_t));
ev.response_type = XCB_CLIENT_MESSAGE;
/* local variables */
static Eina_Bool _ecore_xcb_event_last_mouse_move = EINA_FALSE;
-static Ecore_Event *_ecore_xcb_event_last_mouse_move_event = NULL;
+//static Ecore_Event *_ecore_xcb_event_last_mouse_move_event = NULL;
static Eina_Inlist *_ecore_xcb_mouse_down_info_list = NULL;
static Ecore_X_Time _ecore_xcb_event_last_time;
static Ecore_X_Window _ecore_xcb_event_last_window = 0;
_ecore_xcb_event_mouse_down_info_clear();
_ecore_xcb_event_last_mouse_move = EINA_FALSE;
- if (_ecore_xcb_event_last_mouse_move_event)
- {
- ecore_event_del(_ecore_xcb_event_last_mouse_move_event);
- _ecore_xcb_event_last_mouse_move_event = NULL;
- }
+// if (_ecore_xcb_event_last_mouse_move_event)
+// {
+// ecore_event_del(_ecore_xcb_event_last_mouse_move_event);
+// _ecore_xcb_event_last_mouse_move_event = NULL;
+// }
}
void
return;
}
#endif
- /* WRN("Got Event Error:"); */
- /* WRN("\tMajor Code: %d", err->major_code); */
- /* WRN("\tMinor Code: %d", err->minor_code); */
- /* WRN("\tRequest: %s", xcb_event_get_request_label(err->major_code)); */
- /* WRN("\tError: %s", xcb_event_get_error_label(err->error_code)); */
- /* if (err->error_code == XCB_EVENT_ERROR_BAD_VALUE) */
- /* WRN("\tValue: %d", ((xcb_value_error_t *)err)->bad_value); */
- /* else if (err->error_code == XCB_EVENT_ERROR_BAD_MATCH) */
- /* WRN("\tMatch: %d", ((xcb_match_error_t *)err)->bad_value); */
-
- /* if (err->major_code == XCB_SEND_EVENT) */
- /* { */
- /* WRN("\tSend Event Error"); */
- /* WRN("\t\tSeq: %d", ev->sequence); */
- /* WRN("\t\tFull Seq: %d", ev->full_sequence); */
- /* WRN("\t\tType: %d", ev->response_type); */
- /* } */
+ WRN("Got Event Error:");
+ WRN("\tMajor Code: %d", err->major_code);
+ WRN("\tMinor Code: %d", err->minor_code);
+ WRN("\tRequest: %s", xcb_event_get_request_label(err->major_code));
+ WRN("\tError: %s", xcb_event_get_error_label(err->error_code));
+ if (err->error_code == XCB_EVENT_ERROR_BAD_VALUE)
+ WRN("\tValue: %d", ((xcb_value_error_t *)err)->bad_value);
+ else if (err->error_code == XCB_EVENT_ERROR_BAD_MATCH)
+ WRN("\tMatch: %d", ((xcb_match_error_t *)err)->bad_value);
+
+ if (err->major_code == XCB_SEND_EVENT)
+ {
+ WRN("\tSend Event Error");
+ WRN("\t\tSeq: %d", ev->sequence);
+ WRN("\t\tFull Seq: %d", ev->full_sequence);
+ WRN("\t\tType: %d", ev->response_type);
+ }
/* if (err->major_code == 148) */
/* { */
/* printf("GOT 148 Error\n"); */
_ecore_xcb_event_last_window = e->window;
_ecore_xcb_event_last_root_x = root_x;
_ecore_xcb_event_last_root_y = root_y;
- _ecore_xcb_event_last_mouse_move_event = event;
+// _ecore_xcb_event_last_mouse_move_event = event;
}
static void
Ecore_Event_Mouse_Move *ev;
ev = event;
- if (_ecore_xcb_event_last_mouse_move_event)
- {
- _ecore_xcb_event_last_mouse_move = EINA_FALSE;
- _ecore_xcb_event_last_mouse_move_event = NULL;
- }
+// if (_ecore_xcb_event_last_mouse_move_event)
+// {
+// _ecore_xcb_event_last_mouse_move = EINA_FALSE;
+// _ecore_xcb_event_last_mouse_move_event = NULL;
+// }
if (ev) free(ev);
}
#include "ecore_xcb_private.h"
/* local function prototypes */
-static void _ecore_xcb_netwm_startup_info_free(void *data);
+/* static void _ecore_xcb_netwm_startup_info_free(void *data); */
static Ecore_X_Atom _ecore_xcb_netwm_window_type_atom_get(Ecore_X_Window_Type type);
static Ecore_X_Window_Type _ecore_xcb_netwm_window_type_type_get(Ecore_X_Atom atom);
static Ecore_X_Atom _ecore_xcb_netwm_window_state_atom_get(Ecore_X_Window_State state);
static Ecore_X_Atom _ecore_xcb_netwm_action_atom_get(Ecore_X_Action action);
/* local variables */
-static Eina_Hash *_startup_info = NULL;
+//static Eina_Hash *_startup_info = NULL;
/* local structures */
typedef struct _Ecore_Xcb_Startup_Info Ecore_Xcb_Startup_Info;
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- _startup_info =
- eina_hash_string_superfast_new(_ecore_xcb_netwm_startup_info_free);
+// _startup_info =
+// eina_hash_string_superfast_new(_ecore_xcb_netwm_startup_info_free);
}
EAPI void
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- if (_startup_info) eina_hash_free(_startup_info);
- _startup_info = NULL;
+// if (_startup_info) eina_hash_free(_startup_info);
+// _startup_info = NULL;
}
EAPI Eina_Bool
return 1;
}
-static void
-_ecore_xcb_netwm_startup_info_free(void *data)
-{
- Ecore_Xcb_Startup_Info *info;
+/* static void */
+/* _ecore_xcb_netwm_startup_info_free(void *data) */
+/* { */
+/* Ecore_Xcb_Startup_Info *info; */
- LOGFN(__FILE__, __LINE__, __FUNCTION__);
+/* LOGFN(__FILE__, __LINE__, __FUNCTION__); */
- if (!(info = data)) return;
- if (info->buffer) free(info->buffer);
- if (info->id) free(info->id);
- if (info->name) free(info->name);
- if (info->bin) free(info->bin);
- if (info->icon) free(info->icon);
- if (info->description) free(info->description);
- if (info->wmclass) free(info->wmclass);
- free(info);
-}
+/* if (!(info = data)) return; */
+/* if (info->buffer) free(info->buffer); */
+/* if (info->id) free(info->id); */
+/* if (info->name) free(info->name); */
+/* if (info->bin) free(info->bin); */
+/* if (info->icon) free(info->icon); */
+/* if (info->description) free(info->description); */
+/* if (info->wmclass) free(info->wmclass); */
+/* free(info); */
+/* } */
static Ecore_X_Atom
_ecore_xcb_netwm_window_type_atom_get(Ecore_X_Window_Type type)
char *v = NULL;
_render_avail = EINA_TRUE;
+ _ecore_xcb_xdefaults_init();
if ((reply->major_version > 0) || (reply->minor_version >= 5))
{
_render_argb = EINA_TRUE;
v = getenv("XCURSOR_CORE");
- /* if (!v) */
- /* v = _ecore_xcb_resource_get_string("Xcursor", "core"); */
+ if (!v)
+ v = _ecore_xcb_xdefaults_string_get("Xcursor", "core");
if ((v) && (_ecore_xcb_render_parse_boolean(v)))
_render_argb = EINA_FALSE;
}
{
_render_anim = EINA_TRUE;
v = getenv("XCURSOR_ANIM");
- /* if (!v) */
- /* v = _ecore_xcb_resource_get_string("Xcursor", "anim"); */
+ if (!v)
+ v = _ecore_xcb_xdefaults_string_get("Xcursor", "anim");
if ((v) && (_ecore_xcb_render_parse_boolean(v)))
_render_anim = EINA_FALSE;
}
+ _ecore_xcb_xdefaults_shutdown();
}
}
free(reply);
ecore_x_window_root_list(int *num_ret)
{
xcb_screen_iterator_t iter;
- const xcb_setup_t *setup;
uint8_t i, num;
Ecore_X_Window *roots = NULL;
#ifdef ECORE_XCB_XPRINT
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!num_ret) return NULL;
- *num_ret = 0;
+ if (num_ret) *num_ret = 0;
- setup = xcb_get_setup(_ecore_xcb_conn);
- num = setup->roots_len;
+ /* if (xcb_connection_has_error(_ecore_xcb_conn)) */
+ /* { */
+ /* DBG("XCB Connection Has Error !!!"); */
+ /* return NULL; */
+ /* } */
+
+ num = ecore_x_screen_count_get();
#ifdef ECORE_XCB_XPRINT
ext_reply = xcb_get_extension_data(_ecore_xcb_conn, &xcb_x_print_id);
{
for (j = 0; j < psnum; j++)
{
- if ((_ecore_xcb_window_screen_of_display(i))->root ==
- screens[j])
+ xcb_screen_t *s;
+
+ if ((s = _ecore_xcb_window_screen_of_display(i)))
{
- overlap++;
+ if (s->root == screens[j])
+ overlap++;
}
}
}
for (j = 0; j < psnum; j++)
{
- if ((_ecore_xcb_window_screen_of_display(i))->root ==
- screens[j])
+ xcb_screen_t *s;
+
+ if ((s = _ecore_xcb_window_screen_of_display(i)))
{
- is_print = EINA_TRUE;
- break;
+ if (s->root == screens[j])
+ {
+ is_print = EINA_TRUE;
+ break;
+ }
}
}
if (!is_print)
{
xcb_screen_t *s;
- s = _ecore_xcb_window_screen_of_display(i);
- if (s)
+ if ((s = _ecore_xcb_window_screen_of_display(i)))
{
roots[k] = s->root;
k++;
}
}
}
- *num_ret = k;
+ if (num_ret) *num_ret = k;
free(reply);
}
else
{
/* Fallback to default method */
- iter = xcb_setup_roots_iterator(setup);
+ iter =
+ xcb_setup_roots_iterator(xcb_get_setup(_ecore_xcb_conn));
if (!(roots = malloc(num * sizeof(Ecore_X_Window)))) return NULL;
- *num_ret = num;
+ if (num_ret) *num_ret = num;
for (i = 0; iter.rem; xcb_screen_next(&iter), i++)
roots[i] = iter.data->root;
}
else
{
/* Fallback to default method */
- iter = xcb_setup_roots_iterator(setup);
+ iter =
+ xcb_setup_roots_iterator(xcb_get_setup(_ecore_xcb_conn));
if (!(roots = malloc(num * sizeof(Ecore_X_Window)))) return NULL;
- *num_ret = num;
+ if (num_ret) *num_ret = num;
for (i = 0; iter.rem; xcb_screen_next(&iter), i++)
roots[i] = iter.data->root;
}
#else
- iter = xcb_setup_roots_iterator(setup);
+ iter =
+ xcb_setup_roots_iterator(xcb_get_setup(_ecore_xcb_conn));
if (!(roots = malloc(num * sizeof(Ecore_X_Window)))) return NULL;
- *num_ret = num;
+ if (num_ret) *num_ret = num;
for (i = 0; iter.rem; xcb_screen_next(&iter), i++)
roots[i] = iter.data->root;
#endif