1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2024-11-18 13:54:36 -05:00

Remove value from config struct.

This commit is contained in:
Qball Cow 2014-05-20 11:22:03 +02:00
parent 85172743ee
commit 6d308cefd8
2 changed files with 13 additions and 12 deletions

View file

@ -10,9 +10,6 @@
#define INTERSECT( x, y, w, h, x1, y1, w1, h1 ) ( OVERLAP ( ( x ), ( w ), ( x1 ), ( w1 ) ) && OVERLAP ( ( y ), ( h ), ( y1 ), ( h1 ) ) ) #define INTERSECT( x, y, w, h, x1, y1, w1, h1 ) ( OVERLAP ( ( x ), ( w ), ( x1 ), ( w1 ) ) && OVERLAP ( ( y ), ( h ), ( y1 ), ( h1 ) ) )
extern const char *cache_dir; extern const char *cache_dir;
#ifdef HAVE_I3_IPC_H
extern char *i3_socket_path;
#endif
typedef enum typedef enum
{ {
@ -83,9 +80,7 @@ typedef struct _Settings
// Behavior // Behavior
unsigned int zeltak_mode; unsigned int zeltak_mode;
char * terminal_emulator; char * terminal_emulator;
#ifdef HAVE_I3_IPC_H
unsigned int i3_mode;
#endif
// Key bindings // Key bindings
char * window_key; char * window_key;
char * run_key; char * run_key;

View file

@ -78,6 +78,12 @@
#define FORK 1 #define FORK 1
#define NOFORK 2 #define NOFORK 2
#ifdef HAVE_I3_IPC_H
// This setting is no longer user configurable, but partial to this file:
int config_i3_mode = 0;
extern char *i3_socket_path;
#endif
xdgHandle xdg_handle; xdgHandle xdg_handle;
const char *cache_dir = NULL; const char *cache_dir = NULL;
@ -1540,7 +1546,7 @@ SwitcherMode run_switcher_window ( char **input )
#ifdef HAVE_I3_IPC_H #ifdef HAVE_I3_IPC_H
// In i3 mode, skip the i3bar completely. // In i3 mode, skip the i3bar completely.
if ( config.i3_mode && strstr ( c->class, "i3bar" ) != NULL ) if ( config_i3_mode && strstr ( c->class, "i3bar" ) != NULL )
{ {
continue; continue;
} }
@ -1557,7 +1563,7 @@ SwitcherMode run_switcher_window ( char **input )
desktops = 1; desktops = 1;
} }
#ifdef HAVE_I3_IPC_H #ifdef HAVE_I3_IPC_H
if ( config.i3_mode ) if ( config_i3_mode )
{ {
sprintf ( pattern, "%%-%ds %%s", MAX ( 5, classfield ) ); sprintf ( pattern, "%%-%ds %%s", MAX ( 5, classfield ) );
} }
@ -1585,7 +1591,7 @@ SwitcherMode run_switcher_window ( char **input )
desktop[0] = 0; desktop[0] = 0;
char *line = malloc ( strlen ( c->title ) + strlen ( c->class ) + classfield + 50 ); char *line = malloc ( strlen ( c->title ) + strlen ( c->class ) + classfield + 50 );
#ifdef HAVE_I3_IPC_H #ifdef HAVE_I3_IPC_H
if ( !config.i3_mode ) if ( !config_i3_mode )
{ {
#endif #endif
// find client's desktop. this is zero-based, so we adjust by since most // find client's desktop. this is zero-based, so we adjust by since most
@ -1624,7 +1630,7 @@ SwitcherMode run_switcher_window ( char **input )
{ {
#ifdef HAVE_I3_IPC_H #ifdef HAVE_I3_IPC_H
if ( config.i3_mode ) if ( config_i3_mode )
{ {
// Hack for i3. // Hack for i3.
focus_window_i3 ( i3_socket_path, ids->array[selected_line] ); focus_window_i3 ( i3_socket_path, ids->array[selected_line] );
@ -1838,7 +1844,7 @@ void grab_key ( unsigned int modmask, KeySym key )
#ifdef HAVE_I3_IPC_H #ifdef HAVE_I3_IPC_H
static inline void display_get_i3_path ( Display *display ) static inline void display_get_i3_path ( Display *display )
{ {
config.i3_mode = 0; config_i3_mode = 0;
Atom atom = XInternAtom ( display, I3_SOCKET_PATH_PROP, True ); Atom atom = XInternAtom ( display, I3_SOCKET_PATH_PROP, True );
if ( atom != None ) if ( atom != None )
@ -1847,7 +1853,7 @@ static inline void display_get_i3_path ( Display *display )
if ( i3_socket_path != NULL ) if ( i3_socket_path != NULL )
{ {
config.i3_mode = 1; config_i3_mode = 1;
} }
} }
} }