mirror of
https://github.com/davatorium/rofi.git
synced 2024-11-25 13:55:34 -05:00
Change Window/Atom to xcb_window_t/xcb_atom_t
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
This commit is contained in:
parent
73a0eb3e39
commit
644556b7b6
4 changed files with 12 additions and 12 deletions
|
@ -19,7 +19,7 @@
|
|||
* Hopefully at some point, I3 gets fixed and this is not needed.
|
||||
* This function takes the path to the i3 IPC socket, and the XID of the window.
|
||||
*/
|
||||
void i3_support_focus_window ( Window id );
|
||||
void i3_support_focus_window ( xcb_window_t id );
|
||||
|
||||
/**
|
||||
* @param display The display to read the i3 property from.
|
||||
|
|
|
@ -79,7 +79,7 @@ typedef struct
|
|||
// window lists
|
||||
typedef struct
|
||||
{
|
||||
Window *array;
|
||||
xcb_window_t *array;
|
||||
client **data;
|
||||
int len;
|
||||
} winlist;
|
||||
|
@ -95,7 +95,7 @@ static winlist* winlist_new ()
|
|||
{
|
||||
winlist *l = g_malloc ( sizeof ( winlist ) );
|
||||
l->len = 0;
|
||||
l->array = g_malloc_n ( WINLIST + 1, sizeof ( Window ) );
|
||||
l->array = g_malloc_n ( WINLIST + 1, sizeof ( xcb_window_t ) );
|
||||
l->data = g_malloc_n ( WINLIST + 1, sizeof ( client* ) );
|
||||
return l;
|
||||
}
|
||||
|
@ -109,10 +109,10 @@ static winlist* winlist_new ()
|
|||
*
|
||||
* @returns 0 if failed, 1 is successful.
|
||||
*/
|
||||
static int winlist_append ( winlist *l, Window w, client *d )
|
||||
static int winlist_append ( winlist *l, xcb_window_t w, client *d )
|
||||
{
|
||||
if ( l->len > 0 && !( l->len % WINLIST ) ) {
|
||||
l->array = g_realloc ( l->array, sizeof ( Window ) * ( l->len + WINLIST + 1 ) );
|
||||
l->array = g_realloc ( l->array, sizeof ( xcb_window_t ) * ( l->len + WINLIST + 1 ) );
|
||||
l->data = g_realloc ( l->data, sizeof ( client* ) * ( l->len + WINLIST + 1 ) );
|
||||
}
|
||||
// Make clang-check happy.
|
||||
|
@ -163,7 +163,7 @@ static void winlist_free ( winlist *l )
|
|||
*
|
||||
* @returns -1 if failed, index is successful.
|
||||
*/
|
||||
static int winlist_find ( winlist *l, Window w )
|
||||
static int winlist_find ( winlist *l, xcb_window_t w )
|
||||
{
|
||||
// iterate backwards. Theory is: windows most often accessed will be
|
||||
// nearer the end. Testing with kcachegrind seems to support this...
|
||||
|
@ -239,7 +239,7 @@ static int client_has_window_type ( client *c, xcb_atom_t type )
|
|||
|
||||
static client* window_client ( xcb_connection_t *xcb_connection, xcb_window_t win )
|
||||
{
|
||||
if ( win == None ) {
|
||||
if ( win == XCB_WINDOW_NONE ) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -453,7 +453,7 @@ static void _window_mode_load_data ( Mode *sw, unsigned int cd )
|
|||
|
||||
// build the actual list
|
||||
for ( i = 0; i < ( pd->ids->len ); i++ ) {
|
||||
Window w = pd->ids->array[i];
|
||||
xcb_window_t w = pd->ids->array[i];
|
||||
client *c;
|
||||
|
||||
if ( ( c = window_client ( xcb_connection, w ) ) ) {
|
||||
|
@ -540,7 +540,7 @@ static ModeMode window_mode_result ( Mode *sw, int mretv, G_GNUC_UNUSED char **i
|
|||
else{
|
||||
xcb_ewmh_request_change_active_window ( &xcb_ewmh, xcb_screen_nbr, rmpd->ids->array[selected_line],
|
||||
XCB_EWMH_CLIENT_SOURCE_TYPE_OTHER ,
|
||||
XCB_CURRENT_TIME, None);
|
||||
XCB_CURRENT_TIME, XCB_WINDOW_NONE);
|
||||
xcb_flush(xcb_connection);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
char *i3_socket_path = NULL;
|
||||
extern xcb_screen_t *xcb_screen;
|
||||
|
||||
void i3_support_focus_window ( Window id )
|
||||
void i3_support_focus_window ( xcb_window_t id )
|
||||
{
|
||||
i3_ipc_header_t head;
|
||||
int s;
|
||||
|
@ -132,7 +132,7 @@ void i3_support_free_internals ( void )
|
|||
|
||||
#else
|
||||
|
||||
void i3_support_focus_window ( G_GNUC_UNUSED Window id )
|
||||
void i3_support_focus_window ( G_GNUC_UNUSED xcb_window_t id )
|
||||
{
|
||||
fprintf ( stderr, "Trying to control i3, when i3 support is not enabled.\n" );
|
||||
abort ();
|
||||
|
|
|
@ -485,7 +485,7 @@ static void check_is_ascii ( thread_state *t, G_GNUC_UNUSED gpointer user_data )
|
|||
g_mutex_unlock ( t->mutex );
|
||||
}
|
||||
|
||||
static Window __create_window ( xcb_connection_t *xcb_connection, xcb_screen_t *xcb_screen, MenuFlags menu_flags )
|
||||
static xcb_window_t __create_window ( xcb_connection_t *xcb_connection, xcb_screen_t *xcb_screen, MenuFlags menu_flags )
|
||||
{
|
||||
uint32_t selmask = XCB_CW_BACK_PIXEL | XCB_CW_BORDER_PIXEL | XCB_CW_EVENT_MASK | XCB_CW_COLORMAP;
|
||||
uint32_t selval[] =
|
||||
|
|
Loading…
Reference in a new issue