int win_x, win_y;
int sum_x = 0, sum_y = 0;
+ if (!ecore_x_display_get()) goto end;
+
root_window = ecore_x_window_root_get(client_win);
win = client_win;
win = ecore_x_window_parent_get(win);
}
+end:
if (x)
*x = sum_x;
if (y)
Window winFocus = 0;
int revert = RevertToParent;
+ if (!ecore_x_display_get()) return;
XGetInputFocus(ecore_x_display_get(), &winFocus, &revert);
XKeyEvent event;
IBusIMContext *ibusimcontext = (IBusIMContext*)ecore_imf_context_data_get(ctx);
EINA_SAFETY_ON_NULL_RETURN_VAL(ibusimcontext, EINA_FALSE);
+ if (!ecore_x_display_get()) return EINA_FALSE;
if (type != ECORE_IMF_EVENT_KEY_UP && type != ECORE_IMF_EVENT_KEY_DOWN)
return EINA_FALSE;
event.display = display;
event.window = win;
- event.root = ecore_x_window_root_get(win);
+ event.root = display ? ecore_x_window_root_get(win) : 0;
event.subwindow = None;
event.time = 0;
event.x = 1;
event.same_screen = EINA_TRUE;
if (keycode == -1)
{
- event.keycode = XKeysymToKeycode(display, keysym);
+ event.keycode = display ? XKeysymToKeycode(display, keysym) : 0;
event.state = 0;
}
else
int win_x, win_y;
int sum_x = 0, sum_y = 0;
+ if (!ecore_x_display_get()) goto end;
+
root_window = ecore_x_window_root_get(client_win);
win = client_win;
win = ecore_x_window_parent_get(win);
}
+end:
if (x)
*x = sum_x;
if (y)
EINA_SAFETY_ON_NULL_RETURN(context_scim);
EINA_SAFETY_ON_NULL_RETURN(context_scim->impl);
+ if (!ecore_x_display_get()) return;
ecore_x_e_virtual_keyboard_state_set
(context_scim->impl->client_window, ECORE_X_VIRTUAL_KEYBOARD_STATE_ON);
}
EINA_SAFETY_ON_NULL_RETURN(context_scim);
EINA_SAFETY_ON_NULL_RETURN(context_scim->impl);
+ if (!ecore_x_display_get()) return;
ecore_x_e_virtual_keyboard_state_set
(context_scim->impl->client_window, ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF);
}
EcoreIMFContextISF *ic = find_ic(context);
SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << " context=" << context << " key=" << key.get_key_string() << " ic=" << ic << "\n";
+ if (!ecore_x_display_get()) return;
if (key.is_key_press())
ecore_x_test_fake_key_press(key.get_key_string().c_str());
}
EcoreIMFContextISF *ic = static_cast<EcoreIMFContextISF *>(si->get_frontend_data());
EINA_SAFETY_ON_NULL_RETURN(ic);
+ if (!ecore_x_display_get()) return;
if (_focused_ic == ic)
ecore_x_bell(0);
}
{
Ecore_X_Display *dsp;
dsp = ecore_x_display_get();
- XUnregisterIMInstantiateCallback(dsp,
- NULL, NULL, NULL,
- _ecore_imf_xim_instantiate_cb,
- (XPointer)imf_context_data->im_info);
+ if (dsp)
+ XUnregisterIMInstantiateCallback(dsp,
+ NULL, NULL, NULL,
+ _ecore_imf_xim_instantiate_cb,
+ (XPointer)imf_context_data->im_info);
}
else if (imf_context_data->im_info->im)
{
- XIMCallback im_destroy_callback;
- im_destroy_callback.client_data = NULL;
- im_destroy_callback.callback = NULL;
- XSetIMValues(imf_context_data->im_info->im,
- XNDestroyCallback, &im_destroy_callback,
- NULL);
+ if (ecore_x_display_get())
+ {
+ XIMCallback im_destroy_callback;
+ im_destroy_callback.client_data = NULL;
+ im_destroy_callback.callback = NULL;
+ XSetIMValues(imf_context_data->im_info->im,
+ XNDestroyCallback, &im_destroy_callback,
+ NULL);
+ }
}
}
DBG("ctx=%p, imf_context_data=%p", ctx, imf_context_data);
EINA_SAFETY_ON_NULL_RETURN(imf_context_data);
+ if (!ecore_x_display_get()) return;
ecore_x_e_virtual_keyboard_state_set
(imf_context_data->win, ECORE_X_VIRTUAL_KEYBOARD_STATE_ON);
}
DBG("ctx=%p, imf_context_data=%p", ctx, imf_context_data);
EINA_SAFETY_ON_NULL_RETURN(imf_context_data);
+ if (!ecore_x_display_get()) return;
ecore_x_e_virtual_keyboard_state_set
(imf_context_data->win, ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF);
}
xev.send_event = 0;
xev.display = dsp;
xev.window = win;
- xev.root = ecore_x_window_root_get(win);
+ xev.root = dsp ? ecore_x_window_root_get(win) : 0;
xev.subwindow = win;
xev.time = ev->timestamp;
xev.x = xev.x_root = 0;
xev.y = xev.y_root = 0;
xev.state = 0;
- xev.state |= _ecore_x_event_reverse_modifiers(ev->modifiers);
- xev.state |= _ecore_x_event_reverse_locks(ev->locks);
- xev.keycode = _ecore_imf_xim_keycode_get(dsp, ev->keyname);
+ if (dsp)
+ {
+ xev.state |= _ecore_x_event_reverse_modifiers(ev->modifiers);
+ xev.state |= _ecore_x_event_reverse_locks(ev->locks);
+ xev.keycode = _ecore_imf_xim_keycode_get(dsp, ev->keyname);
+ }
xev.same_screen = True;
if (ic)
XIM_Im_Info *info = open_ims->data;
Ecore_X_Display *display = ecore_x_display_get();
- _ecore_imf_xim_info_im_shutdown(display, EINA_FALSE, info);
+ if (display)
+ _ecore_imf_xim_info_im_shutdown(display, EINA_FALSE, info);
}
if (_ecore_imf_xim_log_dom >= 0)
imf_context_data = ecore_imf_context_data_get(ctx);
EINA_SAFETY_ON_NULL_RETURN_VAL(imf_context_data, NULL);
+ if (!ecore_x_display_get()) return NULL;
ic = imf_context_data->ic;
if (!ic)
{
if (!XSetLocaleModifiers(""))
WRN("Unable to set locale modifiers with XSetLocaleModifiers()");
dsp = ecore_x_display_get();
- info->im = XOpenIM(dsp, NULL, NULL, NULL);
- if (!info->im)
+ if (dsp)
{
- XRegisterIMInstantiateCallback(dsp,
- NULL, NULL, NULL,
- _ecore_imf_xim_instantiate_cb,
- (XPointer)info);
- info->reconnecting = EINA_TRUE;
- return;
+ info->im = XOpenIM(dsp, NULL, NULL, NULL);
+ if (!info->im)
+ {
+ XRegisterIMInstantiateCallback(dsp,
+ NULL, NULL, NULL,
+ _ecore_imf_xim_instantiate_cb,
+ (XPointer)info);
+ info->reconnecting = EINA_TRUE;
+ return;
+ }
+ _ecore_imf_xim_im_setup(info);
}
- _ecore_imf_xim_im_setup(info);
}
}