diff --git a/capplets/display/display-capplet.ui b/capplets/display/display-capplet.ui index 5e0a5d0a8..09672824d 100644 --- a/capplets/display/display-capplet.ui +++ b/capplets/display/display-capplet.ui @@ -4,242 +4,44 @@ 5 - Display Preferences + Monitor Preferences dialog False True + vertical 2 - + True - 5 - 12 + 2 + 2 + 12 + 12 - - True - Drag the monitors to set their place - - - - - - False - False - 0 - - - - + True + vertical + 12 - - - - - 1 - - - - - True - - - _Mirror screens + True - True - False - True - True - - - False - False - 0 - - - - - _Detect Monitors - True - True - False - True - - - False - False - end - 1 - - - - - False - False - 2 - - - - - True - - - True - 0 - Monitor - - - - - - - - False - False - 3 - - - - - True - 3 - 5 - 12 - 6 - - - Include _panel - True - False - True - True - - - 3 - 5 - 1 - 2 - GTK_SHRINK | GTK_FILL - - - - - - True - 0 - _Resolution: - True - resolution_combo - - - 1 - 2 - 1 - 2 - GTK_SHRINK | GTK_FILL - - - - - - True - 0 - Re_fresh rate: - True - refresh_combo - - - 1 - 2 - 2 - 3 - GTK_SHRINK | GTK_FILL - - - - - - True - 0 - R_otation: - True - rotation_combo - - - 3 - 4 - 2 - 3 - GTK_SHRINK | GTK_FILL - - - - - - True - - - 2 - 3 - 1 - 2 - GTK_EXPAND | GTK_SHRINK | GTK_FILL - - - - - - True - - - 2 - 3 - 2 - 3 - - - - - - True - liststore1 - - - - 0 - - - - - 4 - 5 - 2 - 3 - - - - - - True - 12 - 3 - GTK_FILL + 0 - + True 12 - - On + + Sa_me image in all monitors True True False @@ -253,69 +55,278 @@ - - Off + + _Detect monitors True True - False + True True - True - monitor_on_radio False False + end 1 - 1 - 5 - GTK_FILL - GTK_FILL + False + False + 1 + + + + + + + True + vertical + + + True + 0 + Panel icon + + + + + + False + False + 0 + + + + + True + 12 + + + _Show monitors in panel + True + True + False + True + True + + + + + False + False + 1 - False - 4 + 2 + 1 + 2 - + True 0 - Panel icon - - - - - - False - False - 5 - - - - - True - 12 + 0 - - _Show displays in panel + True - True - False - True - True + 6 + 2 + 12 + 6 + + + True + 0 + _Resolution: + True + resolution_combo + + + 2 + 3 + GTK_FILL + + + + + + True + 0 + Re_fresh rate: + True + refresh_combo + + + 3 + 4 + GTK_FILL + + + + + + True + + + 1 + 2 + 2 + 3 + + + + + + True + + + 1 + 2 + 3 + 4 + + + + + + True + 12 + + + On + True + True + False + True + True + True + + + False + False + 0 + + + + + Off + True + True + False + True + True + monitor_on_radio + + + False + False + 1 + + + + + 2 + 1 + 2 + + + + + + True + + + True + 0 + Monitor + + + + + + + + 2 + + + + + + True + 0 + R_otation: + True + rotation_combo + + + 4 + 5 + GTK_FILL + + + + + + True + liststore1 + + + + 0 + + + + + 1 + 2 + 4 + 5 + + + + + + Include _panel + True + False + True + True + + + 5 + 6 + GTK_FILL + + + + + + True + + + + + + 1 + 2 + 5 + 6 + + + + - False - False - 6 + 1 + 2 + + GTK_FILL diff --git a/capplets/display/xrandr-capplet.c b/capplets/display/xrandr-capplet.c index 4d39b023a..aa5917a4a 100644 --- a/capplets/display/xrandr-capplet.c +++ b/capplets/display/xrandr-capplet.c @@ -1464,6 +1464,30 @@ compare_snaps (gconstpointer v1, gconstpointer v2) } } +/* Sets a mouse cursor for a widget's window. As a hack, you can pass + * GDK_BLANK_CURSOR to mean "set the cursor to NULL" (i.e. reset the widget's + * window's cursor to its default). + */ +static void +set_cursor (GtkWidget *widget, GdkCursorType type) +{ + GdkCursor *cursor; + GdkWindow *window; + + if (type == GDK_BLANK_CURSOR) + cursor = NULL; + else + cursor = gdk_cursor_new_for_display (gtk_widget_get_display (widget), type); + + window = gtk_widget_get_window (widget); + + if (window) + gdk_window_set_cursor (window, cursor); + + if (cursor) + gdk_cursor_unref (cursor); +} + static void on_output_event (FooScrollArea *area, FooScrollAreaEvent *event, @@ -1472,6 +1496,13 @@ on_output_event (FooScrollArea *area, GnomeOutputInfo *output = data; App *app = g_object_get_data (G_OBJECT (area), "app"); + /* If the mouse is inside the outputs, set the cursor to "you can move me". See + * on_canvas_event() for where we reset the cursor to the default if it + * exits the outputs' area. + */ + if (!app->current_configuration->clone && get_n_connected (app) > 1) + set_cursor (GTK_WIDGET (area), GDK_FLEUR); + if (event->type == FOO_BUTTON_PRESS) { GrabInfo *info; @@ -1570,24 +1601,17 @@ on_output_event (FooScrollArea *area, } } -#if 0 static void on_canvas_event (FooScrollArea *area, FooScrollAreaEvent *event, gpointer data) { - App *app = g_object_get_data (G_OBJECT (area), "app"); - - if (event->type == FOO_BUTTON_PRESS) - { - app->current_output = NULL; - - rebuild_gui (app); - - foo_scroll_area_invalidate (area); - } + /* If the mouse exits the outputs, reset the cursor to the default. See + * on_output_event() for where we set the cursor to the movement cursor if + * it is over one of the outputs. + */ + set_cursor (GTK_WIDGET (area), GDK_BLANK_CURSOR); } -#endif static PangoLayout * get_display_name (App *app, @@ -1631,9 +1655,7 @@ paint_background (FooScrollArea *area, cairo_fill_preserve (cr); -#if 0 foo_scroll_area_add_input_from_fill (area, cr, on_canvas_event, NULL); -#endif cairo_set_source_rgb (cr, widget->style->dark[GTK_STATE_SELECTED].red / 65535.0, @@ -2360,11 +2382,10 @@ run_application (App *app) g_object_set_data (G_OBJECT (app->area), "app", app); + gtk_widget_set_tooltip_text (app->area, _("Select a monitor to change its properties; drag it to rearrange its placement.")); + /* FIXME: this should be computed dynamically */ - if (gdk_screen_get_height (gdk_screen_get_default ()) <= 600) - foo_scroll_area_set_min_size (FOO_SCROLL_AREA (app->area), -1, 150); - else - foo_scroll_area_set_min_size (FOO_SCROLL_AREA (app->area), -1, 200); + foo_scroll_area_set_min_size (FOO_SCROLL_AREA (app->area), -1, 200); gtk_widget_show (app->area); g_signal_connect (app->area, "paint", G_CALLBACK (on_area_paint), app);