4 * Part of gwm, the Gratuitous Window Manager,
5 * by Gary Wong, <gtw@gnu.org>.
7 * Copyright (C) 2009 Gary Wong
9 * This program is free software: you can redistribute it and/or modify
10 * it under the terms of version 3 of the GNU General Public License as
11 * published by the Free Software Foundation.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
36 #include "window-table.h"
38 static void external_command( char *name
, ... ) {
45 va_start( val
, name
);
46 for( n
= 0; va_arg( val
, char * ); n
++ )
50 args
= alloca( ( n
+ 2 ) * sizeof *args
);
54 va_start( val
, name
);
56 while( ( args
[ n
++ ] = va_arg( val
, char * ) ) )
68 extern void action_raise_lowest( struct gwm_window
*window
,
69 xcb_generic_event_t
*ev
) {
72 xcb_circulate_window( c
, XCB_CIRCULATE_RAISE_LOWEST
,
73 screens
[ focus_frame
->screen
]->root
);
76 extern void action_stack_opposite( struct gwm_window
*window
,
77 xcb_generic_event_t
*ev
) {
80 uint32_t n
= XCB_STACK_MODE_OPPOSITE
;
82 xcb_configure_window( c
, focus_frame
->w
, XCB_CONFIG_WINDOW_STACK_MODE
,
87 extern void action_map_all_icons( struct gwm_window
*window
,
88 xcb_generic_event_t
*ev
) {
92 for( i
= 0; i
< windows
.used
; i
++ )
93 if( windows
.values
[ i
]->type
== WINDOW_MANAGED
&&
94 windows
.values
[ i
]->u
.managed
.state
== STATE_ICONIC
)
95 iconic_to_normal( windows
.values
[ i
] );
98 extern void action_start_xterm( struct gwm_window
*window
,
99 xcb_generic_event_t
*ev
) {
101 external_command( "xterm", NULL
);