[xiph-commits] r12555 - trunk/sushivision

xiphmont at svn.xiph.org xiphmont at svn.xiph.org
Sat Feb 24 19:39:22 PST 2007


Author: xiphmont
Date: 2007-02-24 19:39:20 -0800 (Sat, 24 Feb 2007)
New Revision: 12555

Modified:
   trunk/sushivision/panel-1d.c
   trunk/sushivision/panel-2d.c
Log:
Minor locking fix; improve responsiveness by dropping lock (like it
did originally) during legend render.



Modified: trunk/sushivision/panel-1d.c
===================================================================
--- trunk/sushivision/panel-1d.c	2007-02-25 03:10:13 UTC (rev 12554)
+++ trunk/sushivision/panel-1d.c	2007-02-25 03:39:20 UTC (rev 12555)
@@ -30,7 +30,6 @@
 #include <sys/types.h>
 #include <gtk/gtk.h>
 #include <cairo-ft.h>
-#include <gdk/gdkkeysyms.h>
 #include "internal.h"
 
 #define LINETYPES 6
@@ -977,7 +976,11 @@
   p->private->legend_progress_count++;
   update_legend(p);
   _sushiv_panel_clean_legend(p);
+
+  gdk_threads_leave();
   plot_draw_scales(plot);
+  gdk_threads_enter();
+
   plot_expose_request(plot);
   return 1;
 }
@@ -1157,39 +1160,6 @@
   }
 }
 
-static gboolean panel1d_keypress(GtkWidget *widget,
-				 GdkEventKey *event,
-				 gpointer in){
-  sushiv_panel_t *p = (sushiv_panel_t *)in;
-  
-  if(event->state&GDK_MOD1_MASK) return FALSE;
-  if(event->state&GDK_CONTROL_MASK)return FALSE;
-  
-  /* non-control keypresses */
-  switch(event->keyval){
-    
-  case GDK_Q:
-  case GDK_q:
-    // quit
-    _sushiv_clean_exit(SIGINT);
-    return TRUE;
-
-  case GDK_BackSpace:
-    // undo 
-    _sushiv_panel_undo_down(p);
-    return TRUE;
-
-  case GDK_r:
-  case GDK_space:
-    // redo/forward
-    _sushiv_panel_undo_up(p);
-    return TRUE;
-
-  }
-
-  return FALSE;
-}
-
 void _sushiv_realize_panel1d(sushiv_panel_t *p){
   sushiv_panel1d_t *p1 = p->subtype->p1;
   int i;
@@ -1408,10 +1378,6 @@
     update_x_sel(p);
   }
   
-  g_signal_connect (G_OBJECT (p->private->toplevel), "key-press-event",
-                    G_CALLBACK (panel1d_keypress), p);
-  gtk_window_set_title (GTK_WINDOW (p->private->toplevel), p->name);
-  
   gtk_widget_realize(p->private->toplevel);
   gtk_widget_realize(p->private->graph);
   gtk_widget_realize(GTK_WIDGET(p->private->spinner));

Modified: trunk/sushivision/panel-2d.c
===================================================================
--- trunk/sushivision/panel-2d.c	2007-02-25 03:10:13 UTC (rev 12554)
+++ trunk/sushivision/panel-2d.c	2007-02-25 03:39:20 UTC (rev 12555)
@@ -30,7 +30,6 @@
 #include <sys/types.h>
 #include <gtk/gtk.h>
 #include <cairo-ft.h>
-#include <gdk/gdkkeysyms.h>
 #include "internal.h"
 
 /* helper functions for performing progressive computation */
@@ -1283,7 +1282,11 @@
   p->private->legend_progress_count++;
   update_legend(p);
   _sushiv_panel_clean_legend(p);
+
+  gdk_threads_leave();
   plot_draw_scales(plot);
+  gdk_threads_enter();
+
   plot_expose_request(plot);
   return 1;
 }
@@ -1568,80 +1571,6 @@
   }
 }
 
-static gboolean panel2d_keypress(GtkWidget *widget,
-				 GdkEventKey *event,
-				 gpointer in){
-  sushiv_panel_t *p = (sushiv_panel_t *)in;
-  //  sushiv_panel2d_t *p2 = (sushiv_panel2d_t *)p->internal;
-  
-  // check if the widget with focus is an Entry
-  GtkWidget *focused = gtk_window_get_focus(GTK_WINDOW(widget));
-  int entryp = (focused?GTK_IS_ENTRY(focused):0);
-
-  // don't swallow modified keypresses
-  if(event->state&GDK_MOD1_MASK) return FALSE;
-  if(event->state&GDK_CONTROL_MASK)return FALSE;
-
-  if(entryp){
-    // we still filter, but differently
-    switch(event->keyval){
-    case GDK_BackSpace:
-    case GDK_Home:case GDK_KP_Begin:
-    case GDK_End:case GDK_KP_End:
-    case GDK_Up:case GDK_KP_Up:
-    case GDK_Down:case GDK_KP_Down:
-    case GDK_Left:case GDK_KP_Left:
-    case GDK_Right:case GDK_KP_Right:
-    case GDK_minus:case GDK_KP_Subtract:
-    case GDK_plus:case GDK_KP_Add:
-    case GDK_period:case GDK_KP_Decimal:
-    case GDK_0:case GDK_KP_0:
-    case GDK_1:case GDK_KP_1:
-    case GDK_2:case GDK_KP_2:
-    case GDK_3:case GDK_KP_3:
-    case GDK_4:case GDK_KP_4:
-    case GDK_5:case GDK_KP_5:
-    case GDK_6:case GDK_KP_6:
-    case GDK_7:case GDK_KP_7:
-    case GDK_8:case GDK_KP_8:
-    case GDK_9:case GDK_KP_9:
-    case GDK_Tab:case GDK_KP_Tab:
-    case GDK_ISO_Left_Tab:
-    case GDK_Delete:case GDK_KP_Delete:
-    case GDK_Return:case GDK_ISO_Enter:
-    case GDK_Insert:case GDK_KP_Insert:
-    case GDK_e:case GDK_E:
-      return FALSE;
-    }
-    return TRUE;
-
-  }else{
-        
-    /* non-control keypresses */
-    switch(event->keyval){
-      
-    case GDK_Q:
-    case GDK_q:
-      // quit
-    _sushiv_clean_exit(SIGINT);
-    return TRUE;
-    
-    case GDK_BackSpace:
-      // undo 
-      _sushiv_panel_undo_down(p);
-      return TRUE;
-      
-    case GDK_r:
-    case GDK_space:
-      // redo/forward
-      _sushiv_panel_undo_up(p);
-      return TRUE;
-      
-    } 
-    return FALSE;
-  }
-}
-
 static void _sushiv_realize_panel2d(sushiv_panel_t *p){
   sushiv_panel2d_t *p2 = p->subtype->p2;
   int i;
@@ -1802,10 +1731,6 @@
 
   update_xy_availability(p);
 
-  g_signal_connect (G_OBJECT (p->private->toplevel), "key-press-event",
-                    G_CALLBACK (panel2d_keypress), p);
-  gtk_window_set_title (GTK_WINDOW (p->private->toplevel), p->name);
-
   gtk_widget_realize(p->private->toplevel);
   gtk_widget_realize(p->private->graph);
   gtk_widget_realize(GTK_WIDGET(p->private->spinner));



More information about the commits mailing list