[mutter] ui: Kill tooltips
- From: Florian MÃllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] ui: Kill tooltips
- Date: Thu, 15 Mar 2012 21:28:59 +0000 (UTC)
commit 8ca86fa8bfb6e7ffc06dcb8ae0927574876c2959
Author: Florian MÃllner <fmuellner gnome org>
Date: Fri Mar 18 13:25:59 2011 +0100
ui: Kill tooltips
After the changes in style handling in GTK+, mutter's tooltips no
longer match the tooltip style used in applications. Given that
all buttons in the default layout are well-known, killing tooltips
altogether rather than fixing the styling issues looks like a valid
approach.
https://bugzilla.gnome.org/show_bug.cgi?id=645101
src/Makefile.am | 2 -
src/ui/fixedtip.c | 136 -------------------------------------------
src/ui/fixedtip.h | 69 ----------------------
src/ui/frames.c | 165 -----------------------------------------------------
4 files changed, 0 insertions(+), 372 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index 2d6baaa..5d5dcb9 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -130,8 +130,6 @@ libmutter_la_SOURCES = \
core/core.h \
ui/ui.h \
inlinepixbufs.h \
- ui/fixedtip.c \
- ui/fixedtip.h \
ui/frames.c \
ui/frames.h \
ui/menu.c \
diff --git a/src/ui/frames.c b/src/ui/frames.c
index 1b4ef8d..9f53d42 100644
--- a/src/ui/frames.c
+++ b/src/ui/frames.c
@@ -31,7 +31,6 @@
#include <meta/util.h>
#include "core.h"
#include "menu.h"
-#include "fixedtip.h"
#include <meta/theme.h>
#include <meta/prefs.h>
#include "ui.h"
@@ -98,7 +97,6 @@ static MetaFrameControl get_control (MetaFrames *frames,
MetaUIFrame *frame,
int x,
int y);
-static void clear_tip (MetaFrames *frames);
static void invalidate_all_caches (MetaFrames *frames);
static void invalidate_whole_window (MetaFrames *frames,
MetaUIFrame *frame);
@@ -298,8 +296,6 @@ meta_frames_destroy (GtkWidget *object)
frames = META_FRAMES (object);
- clear_tip (frames);
-
winlist = NULL;
g_hash_table_foreach (frames->frames, listify_func, &winlist);
@@ -724,8 +720,6 @@ meta_frames_unmanage_window (MetaFrames *frames,
{
MetaUIFrame *frame;
- clear_tip (frames);
-
frame = g_hash_table_lookup (frames->frames, &xwindow);
if (frame)
@@ -1124,155 +1118,6 @@ meta_frames_repaint_frame (MetaFrames *frames,
}
static void
-show_tip_now (MetaFrames *frames)
-{
- const char *tiptext;
- MetaUIFrame *frame;
- int x, y, root_x, root_y;
- Window root, child;
- guint mask;
- MetaFrameControl control;
- Display *display;
-
- frame = frames->last_motion_frame;
- if (frame == NULL)
- return;
-
- display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
-
- XQueryPointer (display,
- frame->xwindow,
- &root, &child,
- &root_x, &root_y,
- &x, &y,
- &mask);
-
- control = get_control (frames, frame, x, y);
-
- tiptext = NULL;
- switch (control)
- {
- case META_FRAME_CONTROL_TITLE:
- break;
- case META_FRAME_CONTROL_DELETE:
- tiptext = _("Close Window");
- break;
- case META_FRAME_CONTROL_MENU:
- tiptext = _("Window Menu");
- break;
- case META_FRAME_CONTROL_MINIMIZE:
- tiptext = _("Minimize Window");
- break;
- case META_FRAME_CONTROL_MAXIMIZE:
- tiptext = _("Maximize Window");
- break;
- case META_FRAME_CONTROL_UNMAXIMIZE:
- tiptext = _("Restore Window");
- break;
- case META_FRAME_CONTROL_SHADE:
- tiptext = _("Roll Up Window");
- break;
- case META_FRAME_CONTROL_UNSHADE:
- tiptext = _("Unroll Window");
- break;
- case META_FRAME_CONTROL_ABOVE:
- tiptext = _("Keep Window On Top");
- break;
- case META_FRAME_CONTROL_UNABOVE:
- tiptext = _("Remove Window From Top");
- break;
- case META_FRAME_CONTROL_STICK:
- tiptext = _("Always On Visible Workspace");
- break;
- case META_FRAME_CONTROL_UNSTICK:
- tiptext = _("Put Window On Only One Workspace");
- break;
- case META_FRAME_CONTROL_RESIZE_SE:
- break;
- case META_FRAME_CONTROL_RESIZE_S:
- break;
- case META_FRAME_CONTROL_RESIZE_SW:
- break;
- case META_FRAME_CONTROL_RESIZE_N:
- break;
- case META_FRAME_CONTROL_RESIZE_NE:
- break;
- case META_FRAME_CONTROL_RESIZE_NW:
- break;
- case META_FRAME_CONTROL_RESIZE_W:
- break;
- case META_FRAME_CONTROL_RESIZE_E:
- break;
- case META_FRAME_CONTROL_NONE:
- break;
- case META_FRAME_CONTROL_CLIENT_AREA:
- break;
- }
-
- if (tiptext)
- {
- MetaFrameGeometry fgeom;
- GdkRectangle *rect;
- int dx, dy;
- int screen_number;
-
- meta_frames_calc_geometry (frames, frame, &fgeom);
-
- rect = control_rect (control, &fgeom);
-
- /* get conversion delta for root-to-frame coords */
- dx = root_x - x;
- dy = root_y - y;
-
- /* Align the tooltip to the button right end if RTL */
- if (meta_ui_get_direction() == META_UI_DIRECTION_RTL)
- dx += rect->width;
-
- screen_number = gdk_screen_get_number (gtk_widget_get_screen (GTK_WIDGET (frames)));
-
- meta_fixed_tip_show (display,
- screen_number,
- rect->x + dx,
- rect->y + rect->height + 2 + dy,
- tiptext);
- }
-}
-
-static gboolean
-tip_timeout_func (gpointer data)
-{
- MetaFrames *frames;
-
- frames = data;
-
- show_tip_now (frames);
-
- return FALSE;
-}
-
-#define TIP_DELAY 450
-static void
-queue_tip (MetaFrames *frames)
-{
- clear_tip (frames);
-
- frames->tooltip_timeout = g_timeout_add (TIP_DELAY,
- tip_timeout_func,
- frames);
-}
-
-static void
-clear_tip (MetaFrames *frames)
-{
- if (frames->tooltip_timeout)
- {
- g_source_remove (frames->tooltip_timeout);
- frames->tooltip_timeout = 0;
- }
- meta_fixed_tip_hide ();
-}
-
-static void
redraw_control (MetaFrames *frames,
MetaUIFrame *frame,
MetaFrameControl control)
@@ -1442,8 +1287,6 @@ meta_frames_button_press_event (GtkWidget *widget,
if (frame == NULL)
return FALSE;
- clear_tip (frames);
-
control = get_control (frames, frame, event->x, event->y);
/* focus on click, even if click was on client area */
@@ -1708,8 +1551,6 @@ meta_frames_button_release_event (GtkWidget *widget,
if (frame == NULL)
return FALSE;
- clear_tip (frames);
-
op = meta_core_get_grab_op (display);
if (op == META_GRAB_OP_NONE)
@@ -1946,8 +1787,6 @@ meta_frames_motion_notify_event (GtkWidget *widget,
if (frame == NULL)
return FALSE;
- clear_tip (frames);
-
frames->last_motion_frame = frame;
grab_op = meta_core_get_grab_op (display);
@@ -2018,8 +1857,6 @@ meta_frames_motion_notify_event (GtkWidget *widget,
/* Update prelit control and cursor */
meta_frames_update_prelit_control (frames, frame, control);
-
- queue_tip (frames);
}
break;
@@ -2564,8 +2401,6 @@ meta_frames_leave_notify_event (GtkWidget *widget,
meta_frames_update_prelit_control (frames, frame, META_FRAME_CONTROL_NONE);
- clear_tip (frames);
-
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]