diff src/aosd/aosd_osd.c @ 592:546e779aba64 trunk

[svn] - aosd: immediately hide osd window by single clicking (with mouse button 1) on it
author giacomo
date Wed, 31 Jan 2007 12:12:23 -0800
parents 8be45c22b20a
children 443de962d0a0
line wrap: on
line diff
--- a/src/aosd/aosd_osd.c	Wed Jan 31 12:09:03 2007 -0800
+++ b/src/aosd/aosd_osd.c	Wed Jan 31 12:12:23 2007 -0800
@@ -85,6 +85,19 @@
 }
 
 
+static void
+aosd_button_func ( Ghosd * osd , GhosdEventButton * ev , void * user_data )
+{
+  if ( ev->button == 1 )
+  {
+    pthread_mutex_lock( &aosd_status_mutex );
+    aosd_status = AOSD_STATUS_INTERRUPT;
+    pthread_mutex_unlock( &aosd_status_mutex );
+  }
+  return;
+}
+
+
 static void *
 aosd_thread_func ( void * arg )
 {
@@ -204,6 +217,8 @@
     layout_width + pad_left + pad_right ,
     layout_height + pad_top + pad_bottom );
 
+  ghosd_set_event_button_cb( osd , aosd_button_func , &stop_now );
+
   /* the aosd_status must be checked during the fade and display process
      (if another message arrives, the current transition must be abandoned ) */