Set PID and wm_client_machine hints on rofi window.

This commit is contained in:
Dave Davenport 2017-04-10 09:27:22 +02:00
parent 79c33cfca6
commit 4156d142fe
2 changed files with 19 additions and 0 deletions

View file

@ -768,6 +768,21 @@ void __create_window ( MenuFlags menu_flags )
TICK_N ( "setup startup notification" );
widget_free ( WIDGET ( win ) );
TICK_N ( "done" );
// Set the PID.
pid_t pid= getpid ();
xcb_ewmh_set_wm_pid (&(xcb->ewmh), CacheState.main_window, pid );
// Get hostname
const char *hostname = g_get_host_name ();
char *ahost = g_hostname_to_ascii ( hostname );
if ( ahost != NULL ) {
xcb_icccm_set_wm_client_machine(xcb->connection,
CacheState.main_window,
XCB_ATOM_STRING, 8,
strlen(ahost), ahost);
g_free(ahost);
}
}
/**

View file

@ -57,8 +57,12 @@ int main ( G_GNUC_UNUSED int argc, G_GNUC_UNUSED char **argv )
cairo_surface_t *surf = cairo_image_surface_create ( CAIRO_FORMAT_ARGB32, 100, 100 );
cairo_t *draw = cairo_create ( surf );
PangoContext *p = pango_cairo_create_context ( draw );
textbox_setup();
textbox_set_pango_context ( "default", p );
textbox *box = textbox_create ( "textbox", TB_EDITABLE | TB_AUTOWIDTH | TB_AUTOHEIGHT, NORMAL, "test" );
TASSERT ( box != NULL );