summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2016-03-20 10:16:55 +0100
committerDave Davenport <qball@gmpclient.org>2016-03-20 10:16:55 +0100
commitd36ae81408385bb4278ab3af2aad127d815f2421 (patch)
tree11dcbf7d28a654bda8ed1eec24e6614dbd33632b
parenta2869ef39d1e78c70877df27dc9a6ebc66962842 (diff)
Fix positioning window on top of window.
-rw-r--r--source/dialogs/combi.c2
-rw-r--r--source/dialogs/dmenu.c6
-rw-r--r--source/dialogs/script.c10
-rw-r--r--source/dialogs/window.c6
-rw-r--r--source/helper.c6
-rw-r--r--source/rofi.c10
-rw-r--r--source/textbox.c10
-rw-r--r--source/view.c4
-rw-r--r--source/x11-helper.c4
-rw-r--r--source/xrmoptions.c10
10 files changed, 37 insertions, 31 deletions
diff --git a/source/dialogs/combi.c b/source/dialogs/combi.c
index 3dc1a773..3c911736 100644
--- a/source/dialogs/combi.c
+++ b/source/dialogs/combi.c
@@ -53,7 +53,7 @@ static void combi_mode_parse_switchers ( Mode *sw )
char *savept = NULL;
// Make a copy, as strtok will modify it.
char *switcher_str = g_strdup ( config.combi_modi );
- const char * const sep = ",";
+ const char * const sep = ",";
// Split token on ','. This modifies switcher_str.
for ( char *token = strtok_r ( switcher_str, sep, &savept ); token != NULL;
token = strtok_r ( NULL, sep, &savept ) ) {
diff --git a/source/dialogs/dmenu.c b/source/dialogs/dmenu.c
index 89352bba..4f87bcc2 100644
--- a/source/dialogs/dmenu.c
+++ b/source/dialogs/dmenu.c
@@ -122,8 +122,8 @@ static unsigned int dmenu_mode_get_num_entries ( const Mode *sw )
static void parse_pair ( char *input, struct range_pair *item )
{
- int index = 0;
- const char * const sep = "-";
+ int index = 0;
+ const char * const sep = "-";
for ( char *token = strsep ( &input, sep ); token != NULL; token = strsep ( &input, sep ) ) {
if ( index == 0 ) {
item->start = item->stop = (unsigned int) strtoul ( token, NULL, 10 );
@@ -146,7 +146,7 @@ static void parse_ranges ( char *input, struct range_pair **list, unsigned int *
if ( input == NULL ) {
return;
}
- const char *const sep =",";
+ const char *const sep = ",";
for ( char *token = strtok_r ( input, sep, &endp ); token != NULL; token = strtok_r ( NULL, sep, &endp ) ) {
// Make space.
*list = g_realloc ( ( *list ), ( ( *length ) + 1 ) * sizeof ( struct range_pair ) );
diff --git a/source/dialogs/script.c b/source/dialogs/script.c
index ef2c8d45..928a1dd5 100644
--- a/source/dialogs/script.c
+++ b/source/dialogs/script.c
@@ -179,11 +179,11 @@ static int script_is_not_ascii ( const Mode *sw, unsigned int index )
#include "mode-private.h"
Mode *script_switcher_parse_setup ( const char *str )
{
- Mode *sw = g_malloc0 ( sizeof ( *sw ) );
- char *endp = NULL;
- char *parse = g_strdup ( str );
- unsigned int index = 0;
- const char *const sep = ":";
+ Mode *sw = g_malloc0 ( sizeof ( *sw ) );
+ char *endp = NULL;
+ char *parse = g_strdup ( str );
+ unsigned int index = 0;
+ const char *const sep = ":";
for ( char *token = strtok_r ( parse, sep, &endp ); token != NULL; token = strtok_r ( NULL, sep, &endp ) ) {
if ( index == 0 ) {
g_strlcpy ( sw->name, token, 32 );
diff --git a/source/dialogs/window.c b/source/dialogs/window.c
index 5c34fd0a..b4f4be30 100644
--- a/source/dialogs/window.c
+++ b/source/dialogs/window.c
@@ -265,13 +265,13 @@ static client* window_client ( xcb_window_t win )
xcb_ewmh_get_atoms_reply_t states;
if ( xcb_ewmh_get_wm_state_reply ( &xcb->ewmh, cky, &states, NULL ) ) {
c->states = MIN ( CLIENTSTATE, states.atoms_len );
- memcpy ( c->state, states.atoms, MIN ( CLIENTSTATE, states.atoms_len )*sizeof(xcb_atom_t) );
+ memcpy ( c->state, states.atoms, MIN ( CLIENTSTATE, states.atoms_len ) * sizeof ( xcb_atom_t ) );
xcb_ewmh_get_atoms_reply_wipe ( &states );
}
cky = xcb_ewmh_get_wm_window_type ( &xcb->ewmh, win );
if ( xcb_ewmh_get_wm_window_type_reply ( &xcb->ewmh, cky, &states, NULL ) ) {
c->window_types = MIN ( CLIENTWINDOWTYPE, states.atoms_len );
- memcpy ( c->window_type, states.atoms, MIN ( CLIENTWINDOWTYPE, states.atoms_len )*sizeof(xcb_atom_t) );
+ memcpy ( c->window_type, states.atoms, MIN ( CLIENTWINDOWTYPE, states.atoms_len ) * sizeof ( xcb_atom_t ) );
xcb_ewmh_get_atoms_reply_wipe ( &states );
}
@@ -419,7 +419,7 @@ static void _window_mode_load_data ( Mode *sw, unsigned int cd )
&& !client_has_window_type ( c, xcb->ewmh._NET_WM_WINDOW_TYPE_DESKTOP )
&& !client_has_state ( c, xcb->ewmh._NET_WM_STATE_SKIP_PAGER )
&& !client_has_state ( c, xcb->ewmh._NET_WM_STATE_SKIP_TASKBAR ) ) {
- classfield = MAX ( classfield, (c->class != NULL)?(strlen ( c->class )):0 );
+ classfield = MAX ( classfield, ( c->class != NULL ) ? ( strlen ( c->class ) ) : 0 );
if ( client_has_state ( c, xcb->ewmh._NET_WM_STATE_DEMANDS_ATTENTION ) ) {
c->demands = TRUE;
diff --git a/source/helper.c b/source/helper.c
index e145910c..2485e802 100644
--- a/source/helper.c
+++ b/source/helper.c
@@ -581,6 +581,12 @@ int config_sanity_check ( void )
pango_font_description_free ( pfd );
}
+ if ( config.monitor == -3 ) {
+ // On -3, set to location 1.
+ config.location = 1;
+ config.fullscreen = 0;
+ }
+
if ( found_error ) {
g_string_append ( msg, "Please update your configuration." );
show_error_message ( msg->str, TRUE );
diff --git a/source/rofi.c b/source/rofi.c
index fd048680..0b5618f6 100644
--- a/source/rofi.c
+++ b/source/rofi.c
@@ -306,7 +306,7 @@ static void help ( G_GNUC_UNUSED int argc, char **argv )
printf ( "For more information see: man rofi\n" );
printf ( "Version: "VERSION "\n" );
#ifdef GIT_VERSION
- printf ( "Git: "GIT_VERSION "\n");
+ printf ( "Git: "GIT_VERSION "\n" );
#endif
printf ( "Bugreports: "PACKAGE_BUGREPORT "\n" );
}
@@ -403,10 +403,10 @@ static int add_mode ( const char * token )
}
static void setup_modi ( void )
{
- const char *const sep =",";
- char *savept = NULL;
+ const char *const sep = ",";
+ char *savept = NULL;
// Make a copy, as strtok will modify it.
- char *switcher_str = g_strdup ( config.modi );
+ char *switcher_str = g_strdup ( config.modi );
// Split token on ','. This modifies switcher_str.
for ( char *token = strtok_r ( switcher_str, sep, &savept ); token != NULL; token = strtok_r ( NULL, sep, &savept ) ) {
add_mode ( token );
@@ -613,7 +613,7 @@ int main ( int argc, char *argv[] )
if ( find_arg ( "-v" ) >= 0 || find_arg ( "-version" ) >= 0 ) {
fprintf ( stdout, "Version: "VERSION "\n" );
#ifdef GIT_VERSION
- fprintf ( stdout, "Git: "GIT_VERSION "\n");
+ fprintf ( stdout, "Git: "GIT_VERSION "\n" );
#endif
exit ( EXIT_SUCCESS );
}
diff --git a/source/textbox.c b/source/textbox.c
index f50355ee..1262d56b 100644
--- a/source/textbox.c
+++ b/source/textbox.c
@@ -618,11 +618,11 @@ static void textbox_parse_string ( const char *str, RowColor *color )
if ( str == NULL ) {
return;
}
- char *cstr = g_strdup ( str );
- char *endp = NULL;
- char *token;
- int index = 0;
- const char *const sep = ",";
+ char *cstr = g_strdup ( str );
+ char *endp = NULL;
+ char *token;
+ int index = 0;
+ const char *const sep = ",";
for ( token = strtok_r ( cstr, sep, &endp ); token != NULL; token = strtok_r ( NULL, sep, &endp ) ) {
switch ( index )
{
diff --git a/source/view.c b/source/view.c
index 3a188561..812d8dff 100644
--- a/source/view.c
+++ b/source/view.c
@@ -65,9 +65,9 @@
const char *const separator_style_none = "none";
const char *const separator_style_dash = "dash";
-GThreadPool *tpool = NULL;
+GThreadPool *tpool = NULL;
-RofiViewState *current_active_menu = NULL;
+RofiViewState *current_active_menu = NULL;
struct
{
diff --git a/source/x11-helper.c b/source/x11-helper.c
index a43a760e..18bb18d7 100644
--- a/source/x11-helper.c
+++ b/source/x11-helper.c
@@ -280,8 +280,8 @@ void monitor_active ( workarea *mon )
// place the menu above the window
// if some window is focused, place menu above window, else fall
// back to selected monitor.
- mon->x = t->dst_x;
- mon->y = t->dst_y;
+ mon->x = t->dst_x-r->x;
+ mon->y = t->dst_y-r->y;
mon->w = r->width;
mon->h = r->height;
mon->t = r->border_width;
diff --git a/source/xrmoptions.c b/source/xrmoptions.c
index 021f4198..41d40495 100644
--- a/source/xrmoptions.c
+++ b/source/xrmoptions.c
@@ -523,12 +523,12 @@ void config_parse_xresources_theme_dump ( void )
printf ( "! ROFI Color theme\n" );
printf ( "! User: %s\n", g_get_user_name () );
printf ( "! ------------------------------------------------------------------------------\n" );
- const char * const namePrefix = "rofi";
- const char colorPrefix[] = "color-";
- const char separatorStyle[] = "separator-style";
- unsigned int entries = sizeof ( xrmOptions ) / sizeof ( *xrmOptions );
+ const char * const namePrefix = "rofi";
+ const char colorPrefix[] = "color-";
+ const char separatorStyle[] = "separator-style";
+ unsigned int entries = sizeof ( xrmOptions ) / sizeof ( *xrmOptions );
for ( unsigned int i = 0; i < entries; ++i ) {
- if ( strncmp ( xrmOptions[i].name, colorPrefix, sizeof(colorPrefix)-1 ) == 0 ) {
+ if ( strncmp ( xrmOptions[i].name, colorPrefix, sizeof ( colorPrefix ) - 1 ) == 0 ) {
xresource_dump_entry ( namePrefix, &xrmOptions[i] );
}
else if ( strcmp ( xrmOptions[i].name, separatorStyle ) == 0 ) {