screen_default_visual(): Move to awesome.c
Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
dfd95f1f72
commit
cbf9bbd66a
16
awesome.c
16
awesome.c
|
@ -156,6 +156,21 @@ scan(void)
|
||||||
p_delete(&tree_r);
|
p_delete(&tree_r);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static xcb_visualtype_t *
|
||||||
|
screen_default_visual(xcb_screen_t *s)
|
||||||
|
{
|
||||||
|
xcb_depth_iterator_t depth_iter = xcb_screen_allowed_depths_iterator(s);
|
||||||
|
|
||||||
|
if(depth_iter.data)
|
||||||
|
for(; depth_iter.rem; xcb_depth_next (&depth_iter))
|
||||||
|
for(xcb_visualtype_iterator_t visual_iter = xcb_depth_visuals_iterator(depth_iter.data);
|
||||||
|
visual_iter.rem; xcb_visualtype_next (&visual_iter))
|
||||||
|
if(s->root_visual == visual_iter.data->visual_id)
|
||||||
|
return visual_iter.data;
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
a_refresh_cb(EV_P_ ev_prepare *w, int revents)
|
a_refresh_cb(EV_P_ ev_prepare *w, int revents)
|
||||||
{
|
{
|
||||||
|
@ -359,6 +374,7 @@ main(int argc, char **argv)
|
||||||
fatal("cannot open display");
|
fatal("cannot open display");
|
||||||
|
|
||||||
globalconf.screen = xcb_aux_get_screen(globalconf.connection, globalconf.default_screen);
|
globalconf.screen = xcb_aux_get_screen(globalconf.connection, globalconf.default_screen);
|
||||||
|
globalconf.visual = screen_default_visual(globalconf.screen);
|
||||||
globalconf.default_depth = globalconf.screen->root_depth;
|
globalconf.default_depth = globalconf.screen->root_depth;
|
||||||
globalconf.default_cmap = globalconf.screen->default_colormap;
|
globalconf.default_cmap = globalconf.screen->default_colormap;
|
||||||
|
|
||||||
|
|
17
screen.c
17
screen.c
|
@ -57,21 +57,6 @@ screen_xsitoarea(xcb_xinerama_screen_info_t si)
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
static xcb_visualtype_t *
|
|
||||||
screen_default_visual(xcb_screen_t *s)
|
|
||||||
{
|
|
||||||
xcb_depth_iterator_t depth_iter = xcb_screen_allowed_depths_iterator(s);
|
|
||||||
|
|
||||||
if(depth_iter.data)
|
|
||||||
for(; depth_iter.rem; xcb_depth_next (&depth_iter))
|
|
||||||
for(xcb_visualtype_iterator_t visual_iter = xcb_depth_visuals_iterator(depth_iter.data);
|
|
||||||
visual_iter.rem; xcb_visualtype_next (&visual_iter))
|
|
||||||
if(s->root_visual == visual_iter.data->visual_id)
|
|
||||||
return visual_iter.data;
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
screen_add(screen_t new_screen)
|
screen_add(screen_t new_screen)
|
||||||
{
|
{
|
||||||
|
@ -244,8 +229,6 @@ screen_scan(void)
|
||||||
{
|
{
|
||||||
if(!screen_scan_randr() && !screen_scan_xinerama())
|
if(!screen_scan_randr() && !screen_scan_xinerama())
|
||||||
screen_scan_x11();
|
screen_scan_x11();
|
||||||
|
|
||||||
globalconf.visual = screen_default_visual(globalconf.screen);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Return the Xinerama screen number where the coordinates belongs to.
|
/** Return the Xinerama screen number where the coordinates belongs to.
|
||||||
|
|
Loading…
Reference in New Issue