Commit 964c83a8 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer
Browse files

Fixed intra-session position management for file dialogs and newly created

2003-11-24  Michael Natterer  <mitch@gimp.org>

	Fixed intra-session position management for file dialogs and newly
	created docks:

	* app/widgets/gimpdockable.c (gimp_dockable_detach)
	* app/gui/file-dialog-utils.c (file_dialog_new): don't call
	gtk_window_set_position() on session managed dialogs and docks.

	* app/widgets/gimpdialogfactory.c (gimp_dialog_factory_add_dialog):
	make sure new docks get GDK_HINT_USER_POS set so they remember
	their positions across hide/show.

	* app/widgets/gimpdock.c: removed unused disabled code.
parent 3f0c2b02
2003-11-24 Michael Natterer <mitch@gimp.org>
Fixed intra-session position management for file dialogs and newly
created docks:
* app/widgets/gimpdockable.c (gimp_dockable_detach)
* app/gui/file-dialog-utils.c (file_dialog_new): don't call
gtk_window_set_position() on session managed dialogs and docks.
* app/widgets/gimpdialogfactory.c (gimp_dialog_factory_add_dialog):
make sure new docks get GDK_HINT_USER_POS set so they remember
their positions across hide/show.
* app/widgets/gimpdock.c: removed unused disabled code.
2003-11-24 Sven Neumann <sven@gimp.org>
 
* Made 1.3.23 release.
......@@ -68,7 +68,6 @@ file_dialog_new (Gimp *gimp,
g_object_set_data (G_OBJECT (filesel), "gimp", gimp);
gtk_window_set_position (GTK_WINDOW (filesel), GTK_WIN_POS_MOUSE);
gtk_window_set_role (GTK_WINDOW (filesel), role);
gimp_help_connect (filesel, gimp_standard_help_func, help_id, NULL);
......
......@@ -68,7 +68,6 @@ file_dialog_new (Gimp *gimp,
g_object_set_data (G_OBJECT (filesel), "gimp", gimp);
gtk_window_set_position (GTK_WINDOW (filesel), GTK_WIN_POS_MOUSE);
gtk_window_set_role (GTK_WINDOW (filesel), role);
gimp_help_connect (filesel, gimp_standard_help_func, help_id, NULL);
......
......@@ -817,8 +817,8 @@ gimp_dialog_factory_add_dialog (GimpDialogFactory *factory,
info->toplevel_entry = entry;
/* if we create a new session info, we never call
* gimp_dialog_factory_set_window_geometry(), but still
* the dialog needs GDK_HINT_USER_POS so it keeps its
* gimp_session_info_set_geometry(), but still the
* dialog needs GDK_HINT_USER_POS so it keeps its
* position when hidden/shown within this(!) session.
*/
if (entry->session_managed)
......@@ -869,6 +869,15 @@ gimp_dialog_factory_add_dialog (GimpDialogFactory *factory,
G_GNUC_FUNCTION,
info, info->widget));
/* if we create a new session info, we never call
* gimp_session_info_set_geometry(), but still the
* dialog needs GDK_HINT_USER_POS so it keeps its
* position when hidden/shown within this(!) session.
*/
g_signal_connect (dialog, "configure_event",
G_CALLBACK (gimp_dialog_factory_set_user_pos),
NULL);
factory->session_infos = g_list_append (factory->session_infos, info);
}
}
......
......@@ -2,7 +2,7 @@
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* gimpdock.c
* Copyright (C) 2001 Michael Natterer <mitch@gimp.org>
* Copyright (C) 2001-2003 Michael Natterer <mitch@gimp.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -710,104 +710,3 @@ gimp_dock_separator_drag_drop (GtkWidget *widget,
return FALSE;
}
/*
static gboolean
gimp_dock_separator_button_press (GtkWidget *widget,
GdkEventButton *bevent,
gpointer data)
{
if (bevent->type == GDK_BUTTON_PRESS)
{
if (bevent->button == 1)
{
gtk_grab_add (widget);
}
}
return TRUE;
}
static gboolean
gimp_dock_separator_button_release (GtkWidget *widget,
GdkEventButton *bevent,
gpointer data)
{
if (bevent->button == 1)
{
gtk_grab_remove (widget);
}
return TRUE;
}
static void
gimp_dock_tab_drag_begin (GtkWidget *widget,
GdkDragContext *context,
gpointer data)
{
GimpDockable *dockable;
GtkWidget *window;
GtkWidget *frame;
GtkWidget *label;
dockable = GIMP_DOCKABLE (data);
window = gtk_window_new (GTK_WINDOW_POPUP);
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_OUT);
gtk_container_add (GTK_CONTAINER (window), frame);
gtk_widget_show (frame);
label = gtk_label_new (dockable->name);
gtk_misc_set_padding (GTK_MISC (label), 10, 5);
gtk_container_add (GTK_CONTAINER (frame), label);
gtk_widget_show (label);
gtk_widget_show (window);
g_object_set_data_full (G_OBJECT (dockable), "gimp-dock-drag-widget",
window,
(GDestroyNotify) gtk_widget_destroy);
gtk_drag_set_icon_widget (context, window,
-8, -8);
}
static void
gimp_dock_tab_drag_end (GtkWidget *widget,
GdkDragContext *context,
gpointer data)
{
GimpDockable *dockable;
GtkWidget *drag_widget;
dockable = GIMP_DOCKABLE (data);
drag_widget = g_object_get_data (G_OBJECT (dockable),
"gimp-dock-drag-widget");
if (drag_widget)
{
GtkWidget *dock;
g_object_set_data (G_OBJECT (dockable), "gimp-dock-drag-widget", NULL);
dock = gimp_dock_new ();
gtk_window_set_position (GTK_WINDOW (dock), GTK_WIN_POS_MOUSE);
g_object_ref (dockable);
gimp_dock_remove (dockable->dock, dockable);
gimp_dock_add (GIMP_DOCK (dock), dockable, -1, -1);
g_object_unref (dockable);
gtk_widget_show (dock);
}
}
*/
......@@ -813,8 +813,6 @@ gimp_dockable_detach (GimpDockable *dockable)
gtk_widget_get_screen (GTK_WIDGET (dockable)));
gimp_dock_setup (GIMP_DOCK (dock), src_dock);
gtk_window_set_position (GTK_WINDOW (dock), GTK_WIN_POS_MOUSE);
dockbook = gimp_dockbook_new (GIMP_DOCK (dock)->dialog_factory->menu_factory);
gimp_dock_add_book (GIMP_DOCK (dock), GIMP_DOCKBOOK (dockbook), 0);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment