mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 20:38:08 +01:00
clip: Do not display balloon with workspace name
When the mouse passes over the clip, wmaker would display a "odd" balloon
text with the workspace name, but the balloon itself was covered by the
clip icon!
So if the workspace name was short enough ("Internet" is, by my testing here)
the user wouldn't see anything, the balloon is completely under the clip icon.
I found this issue because one of my workspaces is called "Beyonder" and I
noticed a small "r" under the clip one day.
Instead of trying to fix this, I just removed the whole thing about displaying
the balloon because it is superfluous and I haven't seen any bug reports about
this yet, so it probably means most people are not even aware of it.
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
This commit is contained in:
60
src/dock.c
60
src/dock.c
@@ -119,8 +119,6 @@ static void launchDockedApplication(WAppIcon *btn, Bool withSelection);
|
||||
static void clipAutoLower(void *cdata);
|
||||
static void clipAutoRaise(void *cdata);
|
||||
|
||||
static void showClipBalloon(WDock * dock, int workspace);
|
||||
|
||||
static void make_keys(void)
|
||||
{
|
||||
if (dCommand != NULL)
|
||||
@@ -3002,8 +3000,6 @@ void wClipUpdateForWorkspaceChange(WScreen *scr, int workspace)
|
||||
}
|
||||
wDockShowIcons(scr->workspaces[workspace]->clip);
|
||||
}
|
||||
if (scr->flags.clip_balloon_mapped)
|
||||
showClipBalloon(scr->clip_icon->dock, workspace);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3747,10 +3743,6 @@ static void iconMouseDown(WObjDescriptor *desc, XEvent *event)
|
||||
}
|
||||
}
|
||||
|
||||
if (dock->type == WM_CLIP && scr->flags.clip_balloon_mapped) {
|
||||
XUnmapWindow(dpy, scr->clip_balloon);
|
||||
scr->flags.clip_balloon_mapped = 0;
|
||||
}
|
||||
if (event->xbutton.button == Button1) {
|
||||
if (event->xbutton.state & MOD_MASK)
|
||||
wDockLower(dock);
|
||||
@@ -3817,45 +3809,6 @@ static void iconMouseDown(WObjDescriptor *desc, XEvent *event)
|
||||
}
|
||||
}
|
||||
|
||||
static void showClipBalloon(WDock * dock, int workspace)
|
||||
{
|
||||
int w, h;
|
||||
int x, y;
|
||||
WScreen *scr = dock->screen_ptr;
|
||||
char *text;
|
||||
Window stack[2];
|
||||
|
||||
scr->flags.clip_balloon_mapped = 1;
|
||||
XMapWindow(dpy, scr->clip_balloon);
|
||||
|
||||
text = scr->workspaces[workspace]->name;
|
||||
|
||||
w = WMWidthOfString(scr->clip_title_font, text, strlen(text));
|
||||
|
||||
h = WMFontHeight(scr->clip_title_font);
|
||||
XResizeWindow(dpy, scr->clip_balloon, w, h);
|
||||
|
||||
x = dock->x_pos + CLIP_BUTTON_SIZE * ICON_SIZE / 64;
|
||||
y = dock->y_pos + ICON_SIZE - WMFontHeight(scr->clip_title_font) - 3;
|
||||
|
||||
if (x + w > scr->scr_width) {
|
||||
x = scr->scr_width - w;
|
||||
if (dock->y_pos + ICON_SIZE + h > scr->scr_height)
|
||||
y = dock->y_pos - h - 1;
|
||||
else
|
||||
y = dock->y_pos + ICON_SIZE;
|
||||
XRaiseWindow(dpy, scr->clip_balloon);
|
||||
} else {
|
||||
stack[0] = scr->clip_icon->icon->core->window;
|
||||
stack[1] = scr->clip_balloon;
|
||||
XRestackWindows(dpy, stack, 2);
|
||||
}
|
||||
XMoveWindow(dpy, scr->clip_balloon, x, y);
|
||||
XClearWindow(dpy, scr->clip_balloon);
|
||||
WMDrawString(scr->wmscreen, scr->clip_balloon,
|
||||
scr->clip_title_color[CLIP_NORMAL], scr->clip_title_font, 0, 0, text, strlen(text));
|
||||
}
|
||||
|
||||
static void clipEnterNotify(WObjDescriptor *desc, XEvent *event)
|
||||
{
|
||||
WAppIcon *btn = (WAppIcon *) desc->parent;
|
||||
@@ -3893,15 +3846,6 @@ static void clipEnterNotify(WObjDescriptor *desc, XEvent *event)
|
||||
if (dock->auto_collapse && !dock->auto_expand_magic) {
|
||||
dock->auto_expand_magic = WMAddTimerHandler(AUTO_EXPAND_DELAY, clipAutoExpand, (void *)dock);
|
||||
}
|
||||
|
||||
if (btn->xindex == 0 && btn->yindex == 0)
|
||||
showClipBalloon(dock, dock->screen_ptr->current_workspace);
|
||||
else {
|
||||
if (dock->screen_ptr->flags.clip_balloon_mapped) {
|
||||
XUnmapWindow(dpy, dock->screen_ptr->clip_balloon);
|
||||
dock->screen_ptr->flags.clip_balloon_mapped = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void clipLeave(WDock *dock)
|
||||
@@ -4008,10 +3952,6 @@ static void clipAutoRaise(void *cdata)
|
||||
if (dock->auto_raise_lower)
|
||||
wDockRaise(dock);
|
||||
|
||||
if (dock->screen_ptr->flags.clip_balloon_mapped) {
|
||||
showClipBalloon(dock, dock->screen_ptr->current_workspace);
|
||||
}
|
||||
|
||||
dock->auto_raise_magic = NULL;
|
||||
}
|
||||
|
||||
|
||||
13
src/event.c
13
src/event.c
@@ -1155,19 +1155,6 @@ static void handleEnterNotify(XEvent * event)
|
||||
}
|
||||
}
|
||||
|
||||
/* a little kluge to hide the clip balloon */
|
||||
if (!wPreferences.flags.noclip && scr->flags.clip_balloon_mapped) {
|
||||
if (!desc) {
|
||||
XUnmapWindow(dpy, scr->clip_balloon);
|
||||
scr->flags.clip_balloon_mapped = 0;
|
||||
} else {
|
||||
if (desc->parent_type != WCLASS_DOCK_ICON || scr->clip_icon != desc->parent) {
|
||||
XUnmapWindow(dpy, scr->clip_balloon);
|
||||
scr->flags.clip_balloon_mapped = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (event->xcrossing.window == event->xcrossing.root
|
||||
&& event->xcrossing.detail == NotifyNormal
|
||||
&& event->xcrossing.detail != NotifyInferior && wPreferences.focus_mode != WKF_CLICK) {
|
||||
|
||||
@@ -283,7 +283,6 @@ typedef struct _WScreen {
|
||||
unsigned int added_windows_menu:1;
|
||||
unsigned int startup2:1; /* startup phase 2 */
|
||||
unsigned int supports_tiff:1;
|
||||
unsigned int clip_balloon_mapped:1;
|
||||
unsigned int next_click_is_not_double:1;
|
||||
unsigned int backimage_helper_launched:1;
|
||||
/* some client has issued a WM_COLORMAP_NOTIFY */
|
||||
|
||||
Reference in New Issue
Block a user