diff --git a/ChangeLog b/ChangeLog index d7d46bda4..c37e7ed30 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2002-09-12 Havoc Pennington + + * src/workspace.c (meta_workspace_screen_index) + (meta_workspace_index): fix compiler warnings + + * src/tools/metacity-window-demo.c (menu_items): add a test for + dialogs with no transient parent + + * src/place.c (find_first_fit): Try placing window at origin of + first Xinerama, even if there are no windows to place next to; + makes placement work when no other windows are open on the screen. + 2002-09-09 Havoc Pennington * configure.in: 2.4.1 diff --git a/src/place.c b/src/place.c index 023ff7dac..8da2be8b6 100644 --- a/src/place.c +++ b/src/place.c @@ -427,7 +427,8 @@ find_first_fit (MetaWindow *window, MetaRectangle rect; retval = FALSE; - + sorted = NULL; + rect.width = window->rect.width; rect.height = window->rect.height; @@ -436,6 +437,26 @@ find_first_fit (MetaWindow *window, rect.width += fgeom->left_width + fgeom->right_width; rect.height += fgeom->top_height + fgeom->bottom_height; } + + /* Try origin of first Xinerama */ + rect.x = window->screen->xinerama_infos[0].x_origin; + rect.y = window->screen->xinerama_infos[0].y_origin; + + if (fit_rect_in_xinerama (window->screen, &rect) && + !rectangle_overlaps_some_window (&rect, windows)) + { + *new_x = rect.x; + *new_y = rect.y; + if (fgeom) + { + *new_x += fgeom->left_width; + *new_y += fgeom->top_height; + } + + retval = TRUE; + + goto out; + } sorted = g_list_copy (windows); @@ -468,7 +489,7 @@ find_first_fit (MetaWindow *window, retval = TRUE; goto out; - } + } tmp = tmp->next; } diff --git a/src/run-metacity.sh b/src/run-metacity.sh index 8e99b82d8..df851c491 100755 --- a/src/run-metacity.sh +++ b/src/run-metacity.sh @@ -79,5 +79,5 @@ if test -z "$ONLY_WM"; then fi if test -z "$ONLY_SETUP"; then - METACITY_VERBOSE=1 METACITY_DEBUG=1 METACITY_USE_LOGFILE=1 METACITY_DEBUG_BUTTON_GRABS=1 METACITY_DISPLAY=$CLIENT_DISPLAY exec libtool --mode=execute $DEBUG ./metacity $OPTIONS + METACITY_VERBOSE=1 METACITY_DEBUG=1 METACITY_USE_LOGFILE=1 METACITY_DEBUG_BUTTON_GRABS=1 METACITY_DISPLAY=$CLIENT_DISPLAY exec $DEBUG ./metacity $OPTIONS fi diff --git a/src/tools/metacity-window-demo.c b/src/tools/metacity-window-demo.c index ca75e2ee9..695b0f552 100644 --- a/src/tools/metacity-window-demo.c +++ b/src/tools/metacity-window-demo.c @@ -257,6 +257,28 @@ modal_dialog_cb (gpointer callback_data, gtk_widget_destroy (dialog); } +static void +no_parent_dialog_cb (gpointer callback_data, + guint callback_action, + GtkWidget *widget) +{ + GtkWidget *dialog; + + dialog = gtk_message_dialog_new (NULL, + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_INFO, + GTK_BUTTONS_CLOSE, + "Here is a dialog with no transient parent"); + + /* Close dialog on user response */ + g_signal_connect (G_OBJECT (dialog), + "response", + G_CALLBACK (gtk_widget_destroy), + NULL); + + gtk_widget_show (dialog); +} + static void utility_cb (gpointer callback_data, guint callback_action, @@ -613,6 +635,7 @@ static GtkItemFactoryEntry menu_items[] = { "/Windows/tearoff", NULL, NULL, 0, "" }, { "/Windows/_Dialog", "d", dialog_cb, 0, NULL }, { "/Windows/_Modal dialog", NULL, modal_dialog_cb, 0, NULL }, + { "/Windows/_Parentless dialog", NULL, no_parent_dialog_cb, 0, NULL }, { "/Windows/_Utility", "u", utility_cb, 0, NULL }, { "/Windows/_Splashscreen", "s", splashscreen_cb, 0, NULL }, { "/Windows/_Top dock", NULL, dock_cb, DOCK_TOP, NULL }, diff --git a/src/workspace.c b/src/workspace.c index dedde22fa..c608bbb4f 100644 --- a/src/workspace.c +++ b/src/workspace.c @@ -246,6 +246,7 @@ meta_workspace_index (MetaWorkspace *workspace) } meta_bug ("Workspace does not exist to index!\n"); + return -1; /* compiler warnings */ } int @@ -270,6 +271,7 @@ meta_workspace_screen_index (MetaWorkspace *workspace) } meta_bug ("Workspace does not exist to index!\n"); + return -1; /* compiler warnings */ } /* get windows contained on workspace, including workspace->windows