1999-09-13 Federico Mena Quintero <federico@redhat.com>

* gtkdtree.c (gtk_dtree_class_init): Sigh.  Create a new signal,
	called "possibly_ungrab", used to request the client to ungrab the
	mouse at the proper time.  This is required because the stupid
	clist button press handler grabs the mouse, and we don't want that.
	(gtk_dtree_select_row): Emit the possibly_ungrab signal here.

	* gscreen.c (panel_tree_drag_motion): Set the
	panel->drag_tree_dragging_over flag.
	(panel_tree_drag_leave): Unset said flag.
	(panel_tree_possibly_ungrab): Ungrab the mouse here.
This commit is contained in:
Miguel de Icaza 1999-09-13 20:34:53 +00:00
parent 26d6441348
commit 4a3609a4f7
8 changed files with 80 additions and 25 deletions

7
BUGS
View File

@ -3,10 +3,9 @@ Bugzilla: 3436
bugs.gnome.org:
Important: 1006, 1796
Major cosmetic: 272/875, 487, 899, 1299
Minor cosmetic: 55/208, 115, 308, 383, 398, 449, 479, 597, 781,
874, 931, 956/1126, 1022.1, 1045, 1047, 904, 1329,
1468, 1508, 1750
Non-essential or feature: 779?, 448, 1133, 1121, 1122, 1251
Minor cosmetic: 55/208, 115, 383, 398, 597, 781, 874, 956/1126,
1022.1, 1045, 1047, 904, 1329, 1468, 1508, 1750
Non-essential or feature: 779?, 1133, 1121, 1122, 1251
Look at bug yourself: 1773
1006: Try going to 'ftp://ftp.cs.cuc.edu/' and then clicking on the

View File

@ -5,7 +5,7 @@ AC_INIT(create_vcs)
AC_CONFIG_HEADER(config.h)
PACKAGE=mc
VERSION=4.5.38
VERSION=4.5.39-pre1
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
AC_SUBST(VERSION)

View File

@ -1,3 +1,16 @@
1999-09-13 Federico Mena Quintero <federico@redhat.com>
* gtkdtree.c (gtk_dtree_class_init): Sigh. Create a new signal,
called "possibly_ungrab", used to request the client to ungrab the
mouse at the proper time. This is required because the stupid
clist button press handler grabs the mouse, and we don't want that.
(gtk_dtree_select_row): Emit the possibly_ungrab signal here.
* gscreen.c (panel_tree_drag_motion): Set the
panel->drag_tree_dragging_over flag.
(panel_tree_drag_leave): Unset said flag.
(panel_tree_possibly_ungrab): Ungrab the mouse here.
1999-09-11 Owen Taylor <otaylor@redhat.com>
* gcorba.c (Window_close): Fixed typo in cast.
@ -16,7 +29,7 @@
1999-09-10 Miguel de Icaza <miguel@nuclecu.unam.mx>
* gnome-file-property-dialog.c (apply_uid_group_change): Fix more
broken code.
broken code.
1999-09-09 Federico Mena Quintero <federico@redhat.com>

View File

@ -1310,29 +1310,29 @@ panel_create_file_list (WPanel *panel)
g_free (titles);
gtk_signal_connect_after (GTK_OBJECT (sw), "size_allocate",
(GtkSignalFunc) panel_file_list_size_allocate_hook,
GTK_SIGNAL_FUNC (panel_file_list_size_allocate_hook),
panel);
gtk_signal_connect (GTK_OBJECT (file_list), "select_row",
(GtkSignalFunc) panel_file_list_select_row,
GTK_SIGNAL_FUNC (panel_file_list_select_row),
panel);
gtk_signal_connect (GTK_OBJECT (file_list), "unselect_row",
(GtkSignalFunc) panel_file_list_unselect_row,
GTK_SIGNAL_FUNC (panel_file_list_unselect_row),
panel);
/* Connect to the flist signals */
gtk_signal_connect (GTK_OBJECT (file_list), "row_popup_menu",
(GtkSignalFunc) panel_file_list_row_popup_menu,
GTK_SIGNAL_FUNC (panel_file_list_row_popup_menu),
panel);
gtk_signal_connect (GTK_OBJECT (file_list), "empty_popup_menu",
(GtkSignalFunc) panel_file_list_empty_popup_menu,
GTK_SIGNAL_FUNC (panel_file_list_empty_popup_menu),
panel);
gtk_signal_connect (GTK_OBJECT (file_list), "open_row",
(GtkSignalFunc) panel_file_list_open_row,
GTK_SIGNAL_FUNC (panel_file_list_open_row),
panel);
gtk_signal_connect (GTK_OBJECT (file_list), "start_drag",
(GtkSignalFunc) panel_file_list_start_drag,
GTK_SIGNAL_FUNC (panel_file_list_start_drag),
panel);
/* Set up drag and drop */
@ -1790,6 +1790,22 @@ panel_tree_scan_end (GtkWidget *widget, gpointer data)
set_cursor (data, GDK_TOP_LEFT_ARROW);
}
/* Handler for the possibly_ungrab signal of the dtree widget */
static void
panel_tree_possibly_ungrab (GtkWidget *widget, gpointer data)
{
WPanel *panel;
panel = data;
/* The stupid clist button press handler grabs the mouse. We will get
* called when the user presses the mouse on the tree, so we ungrab it.
* Also, we have to make sure we don't knock away a DnD grab.
*/
if (!panel->drag_tree_dragging_over)
gdk_pointer_ungrab (GDK_CURRENT_TIME);
}
/* Callback for the drag_begin signal of the tree */
static void
panel_tree_drag_begin (GtkWidget *widget, GdkDragContext *context, gpointer data)
@ -2004,6 +2020,7 @@ panel_tree_drag_motion (GtkWidget *widget, GdkDragContext *context, int x, int y
dtree = GTK_DTREE (widget);
panel = data;
panel->drag_tree_dragging_over = TRUE;
panel_setup_drag_scroll (panel, x, y,
panel_tree_scrolling_is_desirable,
panel_tree_scroll);
@ -2092,6 +2109,7 @@ panel_tree_drag_leave (GtkWidget *widget, GdkDragContext *context, guint time, g
panel = data;
panel->drag_tree_dragging_over = FALSE;
panel_cancel_drag_scroll (panel);
if (panel->drag_tree_timeout_id != 0) {
@ -2178,11 +2196,13 @@ panel_create_tree_view (WPanel *panel)
/* DTree signals */
gtk_signal_connect (GTK_OBJECT (tree), "directory_changed",
(GtkSignalFunc) panel_chdir, panel);
GTK_SIGNAL_FUNC (panel_chdir), panel);
gtk_signal_connect (GTK_OBJECT (tree), "scan_begin",
(GtkSignalFunc) panel_tree_scan_begin, panel);
GTK_SIGNAL_FUNC (panel_tree_scan_begin), panel);
gtk_signal_connect (GTK_OBJECT (tree), "scan_end",
(GtkSignalFunc) panel_tree_scan_end, panel);
GTK_SIGNAL_FUNC (panel_tree_scan_end), panel);
gtk_signal_connect (GTK_OBJECT (tree), "possibly_ungrab",
GTK_SIGNAL_FUNC (panel_tree_possibly_ungrab), panel);
/* Set up drag source */

View File

@ -35,6 +35,7 @@ enum {
DIRECTORY_CHANGED,
SCAN_BEGIN,
SCAN_END,
POSSIBLY_UNGRAB,
LAST_SIGNAL
};
@ -238,6 +239,12 @@ gtk_dtree_select_row (GtkCTree *ctree, GtkCTreeNode *row, gint column)
if (dtree->removing_rows)
return;
/* Ask for someone to ungrab the mouse, as the stupid clist grabs it on
* button press. We cannot do it unconditionally because we don't want
* to knock off a DnD grab.
*/
gtk_signal_emit (GTK_OBJECT (dtree), gtk_dtree_signals[POSSIBLY_UNGRAB], NULL);
scan_begin (dtree);
(* parent_class->tree_select_row) (ctree, row, column);
@ -601,16 +608,23 @@ gtk_dtree_class_init (GtkDTreeClass *klass)
gtk_marshal_NONE__NONE,
GTK_TYPE_NONE,
0);
gtk_dtree_signals[POSSIBLY_UNGRAB] =
gtk_signal_new ("possibly_ungrab",
GTK_RUN_FIRST, object_class->type,
GTK_SIGNAL_OFFSET (GtkDTreeClass, possibly_ungrab),
gtk_marshal_NONE__NONE,
GTK_TYPE_NONE,
0);
gtk_object_class_add_signals (object_class, gtk_dtree_signals, LAST_SIGNAL);
object_class->destroy = gtk_dtree_destroy;
object_class->destroy = gtk_dtree_destroy;
widget_class->size_allocate = gtk_dtree_size_allocate;
widget_class->size_allocate = gtk_dtree_size_allocate;
ctree_class->tree_select_row = gtk_dtree_select_row;
ctree_class->tree_expand = gtk_dtree_expand;
ctree_class->tree_collapse = gtk_dtree_collapse;
ctree_class->tree_expand = gtk_dtree_expand;
ctree_class->tree_collapse = gtk_dtree_collapse;
}
static void

View File

@ -44,6 +44,7 @@ typedef struct {
void (* directory_changed) (GtkDTree *dtree, char *directory);
void (* scan_begin) (GtkDTree *dtree);
void (* scan_end) (GtkDTree *dtree);
void (* possibly_ungrab) (GtkDTree *dtree);
} GtkDTreeClass;
guint gtk_dtree_get_type (void);

View File

@ -1,3 +1,8 @@
1999-09-13 Federico Mena Quintero <federico@redhat.com>
* panel.h (WPanel): Added a new field that indicates whether the
user is dragging something over the tree.
1999-08-31 Federico Mena Quintero <federico@redhat.com>
* main.c: In the GNOME version, we want cd_symlinks to be FALSE.

View File

@ -76,7 +76,7 @@ typedef struct format_e {
typedef struct {
Widget widget;
dir_list dir; /* Directory contents */
int list_type; /* listing type (was view_type) */
int active; /* If panel is currently selected */
char cwd [MC_MAXPATHLEN];/* Current Working Directory */
@ -108,7 +108,7 @@ typedef struct {
format_e *status_format; /* Mini status format */
int format_modified; /* If the format was changed this is set */
char *panel_name; /* The panel name */
struct stat dir_stat; /* Stat of current dir: used by execute () */
@ -118,15 +118,15 @@ typedef struct {
int total_width;
int ascent;
int descent;
int searching;
char search_buffer [256];
void *port_ui; /* UI stuff specific to each GUI port */
#ifdef HAVE_GNOME
/* These are standard GtkWidgets */
void *xwindow; /* The toplevel window */
void *table;
@ -172,6 +172,9 @@ typedef struct {
int drag_tree_timeout_id;
file_entry *drag_tree_fe;
/* Whether the user is dragging something over the tree */
int drag_tree_dragging_over;
void *panel_listbox; /* container for the list */
int is_a_desktop_panel;