2011-09-11 misc memo
Misc memo. disable/enable touchpad via xinput, sent a patch to rhbz 732182.
fedora |
This is a simple script to Disable/Enable touchpad from terminal via xinput.
#!/bin/bash
val=0
if [ "$#" = "1" ]; then
val=$1
fi
touchpad_device="FSPPS/2 Sentelic FingerSensingPad"
device_num=`xinput list | grep "$touchpad_device" | cut -d'=' -f2 | awk '{ print $1 }'`
xinput set-prop $device_num "Device Enabled" $val
if [ $val = 0 ]; then
echo "TouchPad Disabled"
else
echo "TouchPad Enabled"
fi
exit 0
Bug 732182 looks timing bug. The bug arose strcmp(3) in refresh_task_list() at line 149. The refresh_task_list() is called from timer handler so if this function is called while gtk objects are releasing, it would be dangerous I think.
148: sprintf (tooltip, _("Memory: %d MB of %d MB used"), memory_used / 1024, sys_stat->mem_total / 1024); 149: if(strcmp(tooltip,gtk_progress_bar_get_text(GTK_PROGRESS_BAR(mem_usage_progress_bar))))
So I reckon it is safe to remove timer event in on_quit().
diff -uNrp lxtask-0.1.3.orig/src/callbacks.c lxtask-0.1.3.new/src/callbacks.c
--- lxtask-0.1.3.orig/src/callbacks.c 2011-09-10 23:28:00.052455181 +0900
+++ lxtask-0.1.3.new/src/callbacks.c 2011-09-10 23:34:32.426446605 +0900
@@ -26,6 +26,8 @@
#include "callbacks.h"
+extern guint rID;
+
void on_button3_toggled_event(GtkButton *button, GdkEventButton *event)
{
full_view = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button));
@@ -137,6 +139,7 @@ void on_show_cached_as_free_toggled (Gtk
void on_quit(void)
{
+ g_source_remove(rID);
save_config();
free(config_file);
コメントを書く
トラックバック - http://d.hatena.ne.jp/masami256/20110911/1315669052
リンク元
- 34 http://b.0r2.info/2011/02/06/macbook-airにlinuxfedoraをインストール/
- 12 http://fedoraforum.org/forum/showthread.php?p=1486244
- 11 http://www.google.co.jp/search?sourceid=navclient&hl=ja&ie=UTF-8&rlz=1T4GGLL_jaJP372JP372&q=create_proc_entey
- 9 http://bit.ly/pESu97
- 9 http://www.google.co.jp/search?q=procfs+&ie=utf-8&oe=utf-8&aq=t&hl=ja
- 9 http://www.google.co.jp/url?sa=t&source=web&cd=2&ved=0CCIQFjAB&url=http://d.hatena.ne.jp/masami256/20091003/1254566837&rct=j&q=mp table&ei=cmNsTrqYPOqjmQWyotAp&usg=AFQjCNGhfqYiS294CRKD1I79v2qmRlPe3A
- 8 http://planet.fedoraproject.org/
- 7 http://is2011.2-d.jp/moin/moin.cgi/システムプログラミング実験/課題メモ
- 7 http://www.google.co.jp/
- 7 http://www.google.co.jp/search?gcx=w&sourceid=chrome&ie=UTF-8&q=double+free+or+corruption
