summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormaniac <maniac>2007-01-08 17:43:28 +0000
committermaniac <maniac>2007-01-08 17:43:28 +0000
commitbee238afaab56c8a8b62e18ddfffb8fc68a7cec7 (patch)
tree28e2f262bedf751c158393a5cf72acd93d76d377
parentf5dd4999c71809184d829d2627c2b96672b551f6 (diff)
downloadberyl-manager-bee238afaab56c8a8b62e18ddfffb8fc68a7cec7.tar.gz
beryl-manager-bee238afaab56c8a8b62e18ddfffb8fc68a7cec7.tar.bz2
beryl-manager: fix fallback WM offset (closes #714)
-rw-r--r--src/main.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/main.c b/src/main.c
index c0420da..500897d 100644
--- a/src/main.c
+++ b/src/main.c
@@ -140,6 +140,8 @@ WMInfo WMs[] = {
};
#define numWM (gint)(sizeof(WMs)/sizeof(WMInfo))
+#define FALLBACKWM_OFFSET 2
+
GtkWidget *useFBItem;
GtkWidget *FBSubItem;
GtkWidget *DMSubItem;
@@ -175,7 +177,7 @@ static void signalHandler(int sig)
{
if (!WM)
{
- WM = fallBackWM + 3;
+ WM = fallBackWM + FALLBACKWM_OFFSET;
startWM();
suspending = 1;
}
@@ -816,7 +818,7 @@ gpointer berylThread(gpointer d)
//if this thread exits, and WM is still beryl, fall back into the fall back WM
if (WM == 0 && useFB)
{
- WM = fallBackWM + 3;
+ WM = fallBackWM + FALLBACKWM_OFFSET;
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(WMs[WM].Item),
TRUE);
//gtk_widget_set_sensitive(useFBItem,FALSE);
@@ -1059,7 +1061,7 @@ gboolean detect_wm(gint wm)
}
if (wm == WM)
WM = -1;
- if (wm == fallBackWM + 3)
+ if (wm == fallBackWM + FALLBACKWM_OFFSET)
fallBackWM = -1;
return FALSE;
}
@@ -1354,11 +1356,11 @@ void init_menu()
smshell = gtk_menu_new();
gtk_menu_item_set_submenu(GTK_MENU_ITEM(mitem), smshell);
- for (i = 3; i < numWM; i++)
+ for (i = FALLBACKWM_OFFSET; i < numWM; i++)
{
mitem = gtk_radio_menu_item_new_with_label(fbk, gettext(WMs[i].Name));
fbk = gtk_radio_menu_item_get_group(GTK_RADIO_MENU_ITEM(mitem));
- if ((i - 3) == fallBackWM)
+ if ((i - FALLBACKWM_OFFSET) == fallBackWM)
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(mitem), TRUE);
gtk_widget_set_sensitive(mitem, useFB);
gtk_menu_shell_append(GTK_MENU_SHELL(smshell), mitem);
@@ -1368,7 +1370,7 @@ void init_menu()
gtk_widget_hide(mitem);
WMs[i].FBItem = mitem;
g_signal_connect(mitem, "toggled", G_CALLBACK(setFallbackWM),
- GINT_TO_POINTER(i - 3));
+ GINT_TO_POINTER(i - FALLBACKWM_OFFSET));
}
mitem = gtk_separator_menu_item_new();
@@ -1625,7 +1627,7 @@ int main(int argc, char **argv)
{
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM
(WMs[i].FBItem), TRUE);
- fallBackWM = i - 3;
+ fallBackWM = i - FALLBACKWM_OFFSET;
break;
}
}