From 4d37cf35dc0a64abf3ca0f672807dd94e01c02b0 Mon Sep 17 00:00:00 2001 From: Qball Cow Date: Tue, 18 Mar 2014 10:55:25 +0100 Subject: [PATCH] Small fix! --- config/config.c | 4 ++-- include/rofi.h | 20 ++++++++++---------- source/rofi.c | 22 +++++++++++----------- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/config/config.c b/config/config.c index d2887ea4..ec8cdb69 100644 --- a/config/config.c +++ b/config/config.c @@ -61,8 +61,8 @@ Settings config = { .window_key = "F12", .run_key = "mod1+F2", .ssh_key = "mod1+F3", - // Location of the window. CENTER, NORTH_WEST, NORTH,NORTH_EAST, etc. - .location = CENTER, + // Location of the window. WL_CENTER, WL_NORTH_WEST, WL_NORTH,WL_NORTH_EAST, etc. + .location = WL_CENTER, // Mode of window, list (Vertical) or dmenu like (Horizontal) .wmode = VERTICAL, // Padding of the window. diff --git a/include/rofi.h b/include/rofi.h index 9f860632..6e6f1310 100644 --- a/include/rofi.h +++ b/include/rofi.h @@ -1,6 +1,6 @@ #ifndef __SIMPLESWITCHER_H__ #define __SIMPLESWITCHER_H__ - +#include #include #define MAX(a, b) ((a) > (b) ? (a) : (b)) @@ -52,15 +52,15 @@ void* reallocate( void *ptr, unsigned long bytes ); void catch_exit( __attribute__( ( unused ) ) int sig ); typedef enum _WindowLocation { - CENTER = 0, - NORTH_WEST = 1, - NORTH = 2, - NORTH_EAST = 3, - EAST = 4, - EAST_SOUTH = 5, - SOUTH = 6, - SOUTH_WEST = 7, - WEST = 8 + WL_CENTER = 0, + WL_NORTH_WEST = 1, + WL_NORTH = 2, + WL_NORTH_EAST = 3, + WL_EAST = 4, + WL_EAST_SOUTH = 5, + WL_SOUTH = 6, + WL_SOUTH_WEST = 7, + WL_WEST = 8 } WindowLocation; typedef enum { diff --git a/source/rofi.c b/source/rofi.c index 91c34097..edfd614c 100644 --- a/source/rofi.c +++ b/source/rofi.c @@ -26,7 +26,6 @@ * */ -#include #define _GNU_SOURCE #include #include @@ -52,6 +51,8 @@ #include #include +#include "rofi.h" + #ifdef HAVE_I3_IPC_H #include #include @@ -62,7 +63,6 @@ #include -#include "rofi.h" #include "run-dialog.h" #include "ssh-dialog.h" #include "dmenu-dialog.h" @@ -950,35 +950,35 @@ MenuReturn menu( char **lines, char **input, char *prompt, Time *time, int *shif // Determine window location switch ( config.location ) { - case NORTH_WEST: + case WL_NORTH_WEST: x=mon.x; - case NORTH: + case WL_NORTH: y=mon.y; break; - case NORTH_EAST: + case WL_NORTH_EAST: y=mon.y; - case EAST: + case WL_EAST: x=mon.x+mon.w-w; break; - case EAST_SOUTH: + case WL_EAST_SOUTH: x=mon.x+mon.w-w; - case SOUTH: + case WL_SOUTH: y=mon.y+mon.h-h; break; - case SOUTH_WEST: + case WL_SOUTH_WEST: y=mon.y+mon.h-h; - case WEST: + case WL_WEST: x=mon.x; break; - case CENTER: + case WL_CENTER: default: break; }