summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormaniac <maniac>2006-11-10 08:13:52 +0000
committermaniac <maniac>2006-11-10 08:13:52 +0000
commit392b9228f06a4c1aa959d2eb28e18af6ea1a8313 (patch)
tree1e85a742b8f08c7d7cc430ee3a0a2f72106c37d2 /src
parent7293234717120d80d96b41d9308dcf820ae91a2e (diff)
downloadberyl-manager-392b9228f06a4c1aa959d2eb28e18af6ea1a8313.tar.gz
beryl-manager-392b9228f06a4c1aa959d2eb28e18af6ea1a8313.tar.bz2
beryl-manager: added option for --use-tfp
Diffstat (limited to 'src')
-rw-r--r--src/main.c39
1 files changed, 34 insertions, 5 deletions
diff --git a/src/main.c b/src/main.c
index 8f78785..dd8877d 100644
--- a/src/main.c
+++ b/src/main.c
@@ -32,6 +32,7 @@ EggTrayIcon * mainIcon;
GtkWidget * menu;
GtkTooltips * tips;
gboolean noGLYield=FALSE;
+gboolean useTFP=FALSE;
gboolean hasMouse=FALSE;
gboolean berylLaunched=FALSE;
gboolean decoratorLaunched=FALSE;
@@ -255,6 +256,14 @@ void load_settings()
}
else
noGLYield=FALSE;
+ if (!XGL)
+ {
+ b=g_key_file_get_boolean(f,"beryl-settings", "use_tfp", &e);
+ if (!e)
+ useTFP=b;
+ e=NULL;
+ } else
+ useTFP=TRUE;
}
g_key_file_free(f);
g_free(path);
@@ -271,6 +280,8 @@ void save_settings()
if (!XGL && NV9XXX)
g_key_file_set_boolean(f,"beryl-settings","no_gl_yield",
noGLYield);
+ if (!XGL)
+ g_key_file_set_boolean(f,"beryl-settings","use_tfp", useTFP);
data = g_key_file_to_data(f,NULL,NULL);
g_file_set_contents(path,data,-1,NULL);
g_key_file_free(f);
@@ -565,15 +576,16 @@ void startWM()
gpointer berylThread(gpointer d)
{
gint ex=0;
- gchar * beryl_command;
+ gchar beryl_command[50];
if (XGL)
- beryl_command = "beryl-xgl";
+ g_strlcpy(beryl_command, "beryl-xgl", 50);
else
{
+ g_strlcpy(beryl_command, "beryl", 50);
if (noGLYield)
- beryl_command = "beryl --skip-gl-yield";
- else
- beryl_command = "beryl";
+ g_strlcat(beryl_command, " --skip-gl-yield", 50);
+ if (useTFP)
+ g_strlcat(beryl_command, " --use-tfp", 50);
}
berylLaunched=TRUE;
while(berylLaunched)
@@ -789,6 +801,13 @@ void setGLYield(GtkWidget * w, gpointer p)
save_settings();
if (WM==0) reloadBeryl();
}
+void setUseTFP(GtkWidget * w, gpointer p)
+{
+ useTFP=gtk_check_menu_item_get_active(
+ GTK_CHECK_MENU_ITEM(w));
+ save_settings();
+ if (WM==0) reloadBeryl();
+}
void init_menu()
{
GtkWidget * mitem;
@@ -860,6 +879,16 @@ void init_menu()
gtk_widget_show(mitem);
g_signal_connect(mitem,"toggled",G_CALLBACK(setGLYield),NULL);
}
+ if (!XGL)
+ {
+ mitem = gtk_check_menu_item_new_with_label(_(
+ "Use Texture-From-Pixmap"));
+ gtk_menu_shell_append(GTK_MENU_SHELL(menu),mitem);
+ gtk_check_menu_item_set_active(
+ GTK_CHECK_MENU_ITEM(mitem),useTFP);
+ gtk_widget_show(mitem);
+ g_signal_connect(mitem,"toggled",G_CALLBACK(setUseTFP),NULL);
+ }
mitem = gtk_separator_menu_item_new();
gtk_menu_shell_append(GTK_MENU_SHELL(menu),mitem);
gtk_widget_show(mitem);