mirror of
https://github.com/davatorium/rofi.git
synced 2024-11-18 13:54:36 -05:00
xcb: Hide some internal details
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
This commit is contained in:
parent
93cf26414e
commit
f042851add
3 changed files with 17 additions and 26 deletions
|
@ -210,11 +210,7 @@ extern xcb_visualtype_t *visual;
|
|||
*/
|
||||
extern xcb_colormap_t map;
|
||||
|
||||
/**
|
||||
* This function tries to create a 32bit TrueColor colormap.
|
||||
* If this fails, it falls back to the default for the connected display.
|
||||
*/
|
||||
void x11_create_visual_and_colormap ( void );
|
||||
void x11_late_setup ( void );
|
||||
|
||||
/**
|
||||
* Gets a surface containing the background image of the desktop.
|
||||
|
|
|
@ -137,21 +137,6 @@ static int switcher_get ( const char *name )
|
|||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Do needed steps to start showing the gui
|
||||
*/
|
||||
static int setup ()
|
||||
{
|
||||
// Create pid file
|
||||
int pfd = create_pid_file ( pidfile );
|
||||
if ( pfd >= 0 ) {
|
||||
// Request truecolor visual.
|
||||
x11_create_visual_and_colormap ( );
|
||||
textbox_setup ();
|
||||
}
|
||||
return pfd;
|
||||
}
|
||||
|
||||
/**
|
||||
* Teardown the gui.
|
||||
*/
|
||||
|
@ -956,17 +941,22 @@ int main ( int argc, char *argv[] )
|
|||
|
||||
rofi_view_workers_initialize ();
|
||||
|
||||
// Create pid file
|
||||
int pfd = create_pid_file ( pidfile );
|
||||
if ( pfd < 0 ) {
|
||||
cleanup ();
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
textbox_setup ();
|
||||
|
||||
x11_late_setup ();
|
||||
|
||||
// Setup signal handling sources.
|
||||
// SIGINT
|
||||
g_unix_signal_add ( SIGINT, main_loop_signal_handler_int, NULL );
|
||||
|
||||
g_idle_add ( startup, NULL );
|
||||
|
||||
// Pidfile + visuals
|
||||
int pfd = setup ();
|
||||
if ( pfd < 0 ) {
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
// Start mainloop.
|
||||
g_main_loop_run ( main_loop );
|
||||
teardown ( pfd );
|
||||
|
|
|
@ -850,7 +850,7 @@ gboolean x11_setup ( GMainLoop *main_loop )
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
void x11_create_visual_and_colormap ( void )
|
||||
static void x11_create_visual_and_colormap ( void )
|
||||
{
|
||||
xcb_depth_t *root_depth = NULL;
|
||||
xcb_depth_iterator_t depth_iter;
|
||||
|
@ -890,6 +890,11 @@ void x11_create_visual_and_colormap ( void )
|
|||
}
|
||||
}
|
||||
|
||||
void x11_late_setup ( void )
|
||||
{
|
||||
x11_create_visual_and_colormap ();
|
||||
}
|
||||
|
||||
xcb_window_t xcb_stuff_get_root_window ( void )
|
||||
{
|
||||
return xcb->screen->root;
|
||||
|
|
Loading…
Reference in a new issue