set x11 randr iface for wl_x11 based on wm presence, not composited state

fixes usage in non-composited x11 environments (eg. openbox)
This commit is contained in:
Mike Blumenkrantz 2016-07-12 12:49:03 -04:00
parent 08aaeffade
commit c6ef590e9e
1 changed files with 6 additions and 1 deletions

View File

@ -15,6 +15,8 @@ E_API void *
e_modapi_init(E_Module *m)
{
int w = 0, h = 0;
Ecore_X_Window root, win;
Eina_Bool managed;
printf("LOAD WL_X11 MODULE\n");
@ -23,6 +25,9 @@ e_modapi_init(E_Module *m)
fprintf(stderr, "X11 connect failed!\n");
return NULL;
}
root = ecore_x_window_root_first_get();
managed = !!ecore_x_window_prop_window_get(root, ECORE_X_ATOM_NET_SUPPORTING_WM_CHECK,
&win, 1);
e_comp_x_randr_canvas_new(ecore_x_window_root_first_get(), 1, 1);
if (!e_comp->ee)
@ -35,7 +40,7 @@ e_modapi_init(E_Module *m)
ecore_evas_name_class_set(e_comp->ee, "E", "compositor");
ecore_evas_screen_geometry_get(e_comp->ee, NULL, NULL, &w, &h);
if (!ecore_x_screen_is_composited(0))
if (!managed)
e_comp_x_randr_screen_iface_set();
if (!e_comp_wl_init()) return NULL;
if (!e_comp_canvas_init(w, h)) return NULL;