RANDR - Don't show a tooltip while a monitor is being dragged

Otherwise the tooltip obscures what you are dragging.

Signed-off-by: Federico Mena Quintero <federico@novell.com>
This commit is contained in:
Federico Mena Quintero 2010-03-17 13:39:06 -06:00
parent 74faa4859b
commit 1665cdbed5

View file

@ -1488,6 +1488,19 @@ set_cursor (GtkWidget *widget, GdkCursorType type)
gdk_cursor_unref (cursor);
}
static void
set_monitors_tooltip (App *app, gboolean is_dragging)
{
const char *text;
if (is_dragging)
text = NULL;
else
text = _("Select a monitor to change its properties; drag it to rearrange its placement.");
gtk_widget_set_tooltip_text (app->area, text);
}
static void
on_output_event (FooScrollArea *area,
FooScrollAreaEvent *event,
@ -1510,6 +1523,7 @@ on_output_event (FooScrollArea *area,
app->current_output = output;
rebuild_gui (app);
set_monitors_tooltip (app, TRUE);
if (!app->current_configuration->clone && get_n_connected (app) > 1)
{
@ -1587,6 +1601,7 @@ on_output_event (FooScrollArea *area,
if (event->type == FOO_BUTTON_RELEASE)
{
foo_scroll_area_end_grab (area);
set_monitors_tooltip (app, FALSE);
g_free (output->user_data);
output->user_data = NULL;
@ -2382,7 +2397,7 @@ 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."));
set_monitors_tooltip (app, FALSE);
/* FIXME: this should be computed dynamically */
foo_scroll_area_set_min_size (FOO_SCROLL_AREA (app->area), -1, 200);