|
@@ -178,27 +178,29 @@ struct sm_app {
|
|
|
unsigned int tile;
|
|
unsigned int tile;
|
|
|
char letter;
|
|
char letter;
|
|
|
unsigned char action;
|
|
unsigned char action;
|
|
|
|
|
+ unsigned char icon; /* APP_ICON_* */
|
|
|
|
|
+ const char *win_title; /* exact canvas title for running/focus */
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
/* Every self-contained GUI application in the pack. Terminal and Settings
|
|
/* Every self-contained GUI application in the pack. Terminal and Settings
|
|
|
* are WM actions (a new terminal canvas and the control panel); edit gets a
|
|
* are WM actions (a new terminal canvas and the control panel); edit gets a
|
|
|
* scratch file so it can start without a file argument. */
|
|
* scratch file so it can start without a file argument. */
|
|
|
static const struct sm_app sm_apps[] = {
|
|
static const struct sm_app sm_apps[] = {
|
|
|
- { "Terminal", "", "", 0x3C8CD2u, 'T', SM_ACT_TERM },
|
|
|
|
|
- { "Files", "/ramfs/bin/files", "", 0xE0A030u, 'F', SM_ACT_SPAWN },
|
|
|
|
|
- { "Web", "/ramfs/bin/browser", "", 0x4CA0E0u, 'W', SM_ACT_SPAWN },
|
|
|
|
|
- { "Gallery", "/ramfs/bin/gallery", "", 0xC864B4u, 'G', SM_ACT_SPAWN },
|
|
|
|
|
- { "Chat", "/ramfs/bin/chat", "", 0x55A055u, 'C', SM_ACT_SPAWN },
|
|
|
|
|
- { "Clock", "/ramfs/bin/clock", "", 0x8C8C9Cu, 'C', SM_ACT_SPAWN },
|
|
|
|
|
- { "Text editor", "/ramfs/bin/edit", "/share/UNTITLED.TXT", 0xD27850u, 'E', SM_ACT_SPAWN },
|
|
|
|
|
- { "Colors", "/ramfs/bin/colors", "", 0xC85A5Au, 'P', SM_ACT_SPAWN },
|
|
|
|
|
- { "Mines", "/ramfs/bin/mines", "", 0x8C6CD2u, 'M', SM_ACT_SPAWN },
|
|
|
|
|
- { "Cards", "/ramfs/bin/solitaire","", 0x3CA08Cu, 'S', SM_ACT_SPAWN },
|
|
|
|
|
- { "Disks", "/ramfs/bin/disks", "", 0x5A8CC8u, 'D', SM_ACT_SPAWN },
|
|
|
|
|
- { "Tasks", "/ramfs/bin/process", "", 0xE0B040u, 'P', SM_ACT_SPAWN },
|
|
|
|
|
- { "Services", "/ramfs/bin/service", "--gui", 0x9A6AC8u, 'V', SM_ACT_SPAWN },
|
|
|
|
|
- { "Settings", "", "", 0x7A7A9Au, 'S', SM_ACT_SETTINGS },
|
|
|
|
|
- { "Date & Time", "/ramfs/bin/settime", "", 0x5AA0A0u, 'D', SM_ACT_SPAWN },
|
|
|
|
|
|
|
+ { "Terminal", "", "", 0x3C8CD2u, 'T', SM_ACT_TERM, APP_ICON_TERMINAL, "term" },
|
|
|
|
|
+ { "Files", "/ramfs/bin/files", "", 0xE0A030u, 'F', SM_ACT_SPAWN, APP_ICON_FILES, "Files" },
|
|
|
|
|
+ { "Web", "/ramfs/bin/browser", "", 0x4CA0E0u, 'W', SM_ACT_SPAWN, APP_ICON_WEB, "Browser" },
|
|
|
|
|
+ { "Gallery", "/ramfs/bin/gallery", "", 0xC864B4u, 'G', SM_ACT_SPAWN, APP_ICON_GALLERY, "ngui gallery" },
|
|
|
|
|
+ { "Chat", "/ramfs/bin/chat", "", 0x55A055u, 'C', SM_ACT_SPAWN, APP_ICON_CHAT, "Chat" },
|
|
|
|
|
+ { "Clock", "/ramfs/bin/clock", "", 0x8C8C9Cu, 'C', SM_ACT_SPAWN, APP_ICON_CLOCK, "clock" },
|
|
|
|
|
+ { "Text editor", "/ramfs/bin/edit", "/share/UNTITLED.TXT", 0xD27850u, 'E', SM_ACT_SPAWN, APP_ICON_EDITOR, "edit" },
|
|
|
|
|
+ { "Colors", "/ramfs/bin/colors", "", 0xC85A5Au, 'P', SM_ACT_SPAWN, APP_ICON_COLORS, "colors" },
|
|
|
|
|
+ { "Mines", "/ramfs/bin/mines", "", 0x8C6CD2u, 'M', SM_ACT_SPAWN, APP_ICON_MINES, "mines" },
|
|
|
|
|
+ { "Cards", "/ramfs/bin/solitaire","", 0x3CA08Cu, 'S', SM_ACT_SPAWN, APP_ICON_CARDS, "Solitaire" },
|
|
|
|
|
+ { "Disks", "/ramfs/bin/disks", "", 0x5A8CC8u, 'D', SM_ACT_SPAWN, APP_ICON_DISKS, "Disks" },
|
|
|
|
|
+ { "Tasks", "/ramfs/bin/process", "", 0xE0B040u, 'P', SM_ACT_SPAWN, APP_ICON_TASKS, "Processes" },
|
|
|
|
|
+ { "Services", "/ramfs/bin/service", "--gui", 0x9A6AC8u, 'V', SM_ACT_SPAWN, APP_ICON_SERVICES, "Services" },
|
|
|
|
|
+ { "Settings", "", "", 0x7A7A9Au, 'S', SM_ACT_SETTINGS, APP_ICON_SETTINGS, "Control Center" },
|
|
|
|
|
+ { "Date & Time", "/ramfs/bin/settime", "", 0x5AA0A0u, 'D', SM_ACT_SPAWN, APP_ICON_DATETIME, "Date & Time" },
|
|
|
};
|
|
};
|
|
|
#define SM_NAPP ((int)(sizeof(sm_apps) / sizeof(sm_apps[0])))
|
|
#define SM_NAPP ((int)(sizeof(sm_apps) / sizeof(sm_apps[0])))
|
|
|
|
|
|
|
@@ -227,6 +229,17 @@ static int sm_update_hover(unsigned int mx, unsigned int my);
|
|
|
static void sm_close(void);
|
|
static void sm_close(void);
|
|
|
static void sm_launch(int idx);
|
|
static void sm_launch(int idx);
|
|
|
|
|
|
|
|
|
|
+/* Bottom dock (defined with the start-menu/launch helpers further down). */
|
|
|
|
|
+static void dock_update(unsigned int mx, unsigned int my);
|
|
|
|
|
+static void dock_draw(void);
|
|
|
|
|
+static void dock_damage(struct wm_present_info *p);
|
|
|
|
|
+static void dock_mark_drawn(void);
|
|
|
|
|
+static int dock_click_at(unsigned int mx, unsigned int my);
|
|
|
|
|
+static void dock_capture_update(unsigned int mx, unsigned int my,
|
|
|
|
|
+ unsigned int buttons);
|
|
|
|
|
+static int dock_icon_at(unsigned int mx, unsigned int my);
|
|
|
|
|
+static int dock_pointer_inside(unsigned int mx, unsigned int my);
|
|
|
|
|
+
|
|
|
/* Network status icon (right side of the bar). */
|
|
/* Network status icon (right side of the bar). */
|
|
|
#define BAR_NET_W 24
|
|
#define BAR_NET_W 24
|
|
|
#define BAR_NET_Y 7
|
|
#define BAR_NET_Y 7
|
|
@@ -239,6 +252,46 @@ static int bar_net_bars;
|
|
|
static unsigned int bar_net_color = 0xFF5050u;
|
|
static unsigned int bar_net_color = 0xFF5050u;
|
|
|
static int control_pid;
|
|
static int control_pid;
|
|
|
|
|
|
|
|
|
|
+/* Bottom dock (the drawing and hit-test code lives near the launch
|
|
|
|
|
+ * helpers, after the start menu; do_update needs the state earlier). */
|
|
|
|
|
+#define DOCK_BASE_MAX 48
|
|
|
|
|
+#define DOCK_BASE_MIN 24
|
|
|
|
|
+#define DOCK_PAD 14
|
|
|
|
|
+#define DOCK_PANEL_EXTRA 14
|
|
|
|
|
+#define DOCK_BOTTOM 8
|
|
|
|
|
+#define DOCK_ICON_BOTTOM 7
|
|
|
|
|
+#define DOCK_SCALE_ONE 256
|
|
|
|
|
+#define DOCK_SCALE_MAX 448 /* 1.75x in 8.8 fixed point */
|
|
|
|
|
+#define DOCK_SEP_GAP 6
|
|
|
|
|
+#define DOCK_LABEL_H 26
|
|
|
|
|
+#define DOCK_LABEL_GAP 32
|
|
|
|
|
+
|
|
|
|
|
+static const unsigned char dock_apps[] = {
|
|
|
|
|
+ 0, 1, 2, 4, 6, 3, 5, 7, 8, 9, 10, 11, 13
|
|
|
|
|
+};
|
|
|
|
|
+#define DOCK_N ((int)(sizeof(dock_apps) / sizeof(dock_apps[0])))
|
|
|
|
|
+
|
|
|
|
|
+struct dock_layout {
|
|
|
|
|
+ int base, gap, pad;
|
|
|
|
|
+ int panel_x, panel_y, panel_w, panel_h, panel_bottom;
|
|
|
|
|
+ int icon_bottom;
|
|
|
|
|
+ int x[DOCK_N], y[DOCK_N], size[DOCK_N];
|
|
|
|
|
+ int base_center[DOCK_N];
|
|
|
|
|
+ int label_idx, label_x, label_y, label_w, label_h;
|
|
|
|
|
+ struct wm_rect visual;
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+static struct dock_layout dock;
|
|
|
|
|
+static unsigned short dock_scale[DOCK_N];
|
|
|
|
|
+static int dock_scale_ready;
|
|
|
|
|
+static int dock_active;
|
|
|
|
|
+static int dock_hover;
|
|
|
|
|
+static int dock_dirty;
|
|
|
|
|
+static int dock_captured;
|
|
|
|
|
+static struct wm_rect dock_prev;
|
|
|
|
|
+static int dock_prev_valid;
|
|
|
|
|
+static unsigned int dock_last_paint_ms;
|
|
|
|
|
+
|
|
|
static void bar_notice(const char *msg)
|
|
static void bar_notice(const char *msg)
|
|
|
{
|
|
{
|
|
|
unsigned int i;
|
|
unsigned int i;
|
|
@@ -1341,6 +1394,11 @@ static void osd_draw(void)
|
|
|
* that may have overwritten them. */
|
|
* that may have overwritten them. */
|
|
|
static void wm_overlays(struct wm_present_info *p)
|
|
static void wm_overlays(struct wm_present_info *p)
|
|
|
{
|
|
{
|
|
|
|
|
+ /* The dock sits above the windows, so a window move/resize or a
|
|
|
|
|
+ * drag-shadow copy that crossed it must put it back. */
|
|
|
|
|
+ dock_damage(p);
|
|
|
|
|
+ dock_draw();
|
|
|
|
|
+ dock_mark_drawn();
|
|
|
if (osd_show) {
|
|
if (osd_show) {
|
|
|
osd_draw();
|
|
osd_draw();
|
|
|
add_rect(p, osd_x, osd_y, osd_w, osd_h);
|
|
add_rect(p, osd_x, osd_y, osd_w, osd_h);
|
|
@@ -1351,11 +1409,31 @@ static void wm_overlays(struct wm_present_info *p)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+/* True when a screen rectangle contains pixels from an overlay rather than
|
|
|
|
|
+ * the desktop/window stack. The dock is always on top, and the brightness
|
|
|
|
|
+ * OSD is drawn above the windows while it is visible; copying such a block
|
|
|
|
|
+ * as if it were the window would drag the overlay along with it. */
|
|
|
|
|
+static int shadow_overlay_covers(int x, int y, int w, int h)
|
|
|
|
|
+{
|
|
|
|
|
+ if (dock.visual.w && dock.visual.h &&
|
|
|
|
|
+ x < dock.visual.x + (int)dock.visual.w &&
|
|
|
|
|
+ x + w > dock.visual.x &&
|
|
|
|
|
+ y < dock.visual.y + (int)dock.visual.h &&
|
|
|
|
|
+ y + h > dock.visual.y)
|
|
|
|
|
+ return 1;
|
|
|
|
|
+ if (osd_visible &&
|
|
|
|
|
+ x < osd_x + (int)osd_w && x + w > osd_x &&
|
|
|
|
|
+ y < osd_y + (int)osd_h && y + h > osd_y)
|
|
|
|
|
+ return 1;
|
|
|
|
|
+ return 0;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
/* A focused window is topmost, so the shadow contains exactly its pixels in
|
|
/* A focused window is topmost, so the shadow contains exactly its pixels in
|
|
|
- * the old rectangle. Move that block and repaint only the old part the new
|
|
|
|
|
- * rectangle does not cover. When either rectangle is partly off-screen the
|
|
|
|
|
- * shadow has no valid pixels for the hidden part, so repaint the new rect
|
|
|
|
|
- * instead of copying desktop background into the window. */
|
|
|
|
|
|
|
+ * the old rectangle, unless the dock or the brightness OSD covers part of
|
|
|
|
|
+ * it. Move that block and repaint only the old part the new rectangle does
|
|
|
|
|
+ * not cover. When either rectangle is partly off-screen, or an overlay hid
|
|
|
|
|
+ * part of the source, the shadow has no valid pixels there, so repaint the
|
|
|
|
|
+ * new rect instead of copying overlay pixels into the window. */
|
|
|
static void move_window_pixels(struct uwin *u, int ox, int oy, int nx, int ny)
|
|
static void move_window_pixels(struct uwin *u, int ox, int oy, int nx, int ny)
|
|
|
{
|
|
{
|
|
|
struct wm_present_info present;
|
|
struct wm_present_info present;
|
|
@@ -1363,7 +1441,8 @@ static void move_window_pixels(struct uwin *u, int ox, int oy, int nx, int ny)
|
|
|
unsigned int np, k;
|
|
unsigned int np, k;
|
|
|
int w = (int)u->info.w, h = (int)u->info.h;
|
|
int w = (int)u->info.w, h = (int)u->info.h;
|
|
|
int old_on = ox >= 0 && oy >= 0 &&
|
|
int old_on = ox >= 0 && oy >= 0 &&
|
|
|
- ox + w <= (int)fbw && oy + h <= (int)fbh;
|
|
|
|
|
|
|
+ ox + w <= (int)fbw && oy + h <= (int)fbh &&
|
|
|
|
|
+ !shadow_overlay_covers(ox, oy, w, h);
|
|
|
int new_on = nx >= 0 && ny >= 0 &&
|
|
int new_on = nx >= 0 && ny >= 0 &&
|
|
|
nx + w <= (int)fbw && ny + h <= (int)fbh;
|
|
nx + w <= (int)fbw && ny + h <= (int)fbh;
|
|
|
|
|
|
|
@@ -1665,8 +1744,11 @@ static void sm_draw_app(int i, const struct sm_layout *l)
|
|
|
if (sm_hot == i)
|
|
if (sm_hot == i)
|
|
|
sm_fill_round(l->row_x, ry + 1, l->row_w,
|
|
sm_fill_round(l->row_x, ry + 1, l->row_w,
|
|
|
l->row_h - 2, SM_RADIUS, SM_PANEL_ALT);
|
|
l->row_h - 2, SM_RADIUS, SM_PANEL_ALT);
|
|
|
- sm_tile(l->row_x + 10, ry + (l->row_h - tile) / 2, tile,
|
|
|
|
|
- a->tile, a->letter);
|
|
|
|
|
|
|
+ if (!usurf_app_icon(&screen, l->row_x + 10,
|
|
|
|
|
+ ry + (l->row_h - tile) / 2, tile,
|
|
|
|
|
+ (enum app_icon)a->icon))
|
|
|
|
|
+ sm_tile(l->row_x + 10, ry + (l->row_h - tile) / 2, tile,
|
|
|
|
|
+ a->tile, a->letter);
|
|
|
usurf_text(&screen, l->row_x + 36, ty, a->label, SM_TEXT,
|
|
usurf_text(&screen, l->row_x + 36, ty, a->label, SM_TEXT,
|
|
|
l->x, l->y, (unsigned int)l->w, (unsigned int)l->h);
|
|
l->x, l->y, (unsigned int)l->w, (unsigned int)l->h);
|
|
|
}
|
|
}
|
|
@@ -1850,6 +1932,8 @@ static void do_update(struct wm_status *st)
|
|
|
unsigned int msg_now = u_ticks_ms();
|
|
unsigned int msg_now = u_ticks_ms();
|
|
|
int osd_hide = 0, osd_repaint = 0;
|
|
int osd_hide = 0, osd_repaint = 0;
|
|
|
int sm_dirty;
|
|
int sm_dirty;
|
|
|
|
|
+ int dock_redraw = 0, dock_overlap = 0;
|
|
|
|
|
+ unsigned int dj;
|
|
|
|
|
|
|
|
/* The kernel bumps backlight_seq on every brightness key/command.
|
|
/* The kernel bumps backlight_seq on every brightness key/command.
|
|
|
* Pop the OSD on a change and keep it up for OSD_MS after the last
|
|
* Pop the OSD on a change and keep it up for OSD_MS after the last
|
|
@@ -1877,6 +1961,7 @@ static void do_update(struct wm_status *st)
|
|
|
osd_repaint = 1;
|
|
osd_repaint = 1;
|
|
|
|
|
|
|
|
sm_dirty = sm_update_hover(st->mouse.x, st->mouse.y);
|
|
sm_dirty = sm_update_hover(st->mouse.x, st->mouse.y);
|
|
|
|
|
+ dock_update(st->mouse.x, st->mouse.y);
|
|
|
|
|
|
|
|
/* The boot-scan window is created before the terminal so the terminal
|
|
/* The boot-scan window is created before the terminal so the terminal
|
|
|
* stays the newest (last) window and keeps the keyboard focus. Wait
|
|
* stays the newest (last) window and keeps the keyboard focus. Wait
|
|
@@ -2102,6 +2187,8 @@ static void do_update(struct wm_status *st)
|
|
|
{
|
|
{
|
|
|
draw_rect(0, 0, fbw, fbh);
|
|
draw_rect(0, 0, fbw, fbh);
|
|
|
draw_bar();
|
|
draw_bar();
|
|
|
|
|
+ dock_draw();
|
|
|
|
|
+ dock_mark_drawn();
|
|
|
if (osd_show)
|
|
if (osd_show)
|
|
|
osd_draw();
|
|
osd_draw();
|
|
|
osd_visible = osd_show;
|
|
osd_visible = osd_show;
|
|
@@ -2156,6 +2243,26 @@ static void do_update(struct wm_status *st)
|
|
|
if (sm_dirty && sm_open)
|
|
if (sm_dirty && sm_open)
|
|
|
need = 1;
|
|
need = 1;
|
|
|
|
|
|
|
|
|
|
+ for (dj = 0; dj < present.count; dj++) {
|
|
|
|
|
+ int rx = present.rect[dj].x;
|
|
|
|
|
+ int ry = present.rect[dj].y;
|
|
|
|
|
+ int rx1 = rx + (int)present.rect[dj].w;
|
|
|
|
|
+ int ry1 = ry + (int)present.rect[dj].h;
|
|
|
|
|
+ int dx1 = dock.visual.x + (int)dock.visual.w;
|
|
|
|
|
+ int dy1 = dock.visual.y + (int)dock.visual.h;
|
|
|
|
|
+
|
|
|
|
|
+ if (rx < dx1 && rx1 > dock.visual.x &&
|
|
|
|
|
+ ry < dy1 && ry1 > dock.visual.y) {
|
|
|
|
|
+ dock_overlap = 1;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if (dock_dirty || dock_overlap) {
|
|
|
|
|
+ dock_damage(&present);
|
|
|
|
|
+ dock_redraw = 1;
|
|
|
|
|
+ need = 1;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if (!need) {
|
|
if (!need) {
|
|
|
/* Drag movement is handled below; a stationary mouse can be
|
|
/* Drag movement is handled below; a stationary mouse can be
|
|
|
* left to the kernel's cursor overlay. */
|
|
* left to the kernel's cursor overlay. */
|
|
@@ -2172,6 +2279,10 @@ static void do_update(struct wm_status *st)
|
|
|
present.rect[i].w, present.rect[i].h);
|
|
present.rect[i].w, present.rect[i].h);
|
|
|
if (bar_dirty)
|
|
if (bar_dirty)
|
|
|
draw_bar();
|
|
draw_bar();
|
|
|
|
|
+ if (dock_redraw) {
|
|
|
|
|
+ dock_draw();
|
|
|
|
|
+ dock_mark_drawn();
|
|
|
|
|
+ }
|
|
|
if (osd_show) {
|
|
if (osd_show) {
|
|
|
osd_draw();
|
|
osd_draw();
|
|
|
add_rect(&present, osd_x, osd_y, osd_w, osd_h);
|
|
add_rect(&present, osd_x, osd_y, osd_w, osd_h);
|
|
@@ -2310,6 +2421,429 @@ static void dismiss_popover_outside(unsigned int mx, unsigned int my)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+/* ---- Bottom dock -------------------------------------------------------
|
|
|
|
|
+ * A macOS-like pinned icon bar. The icons are full-colour GNOME app icons
|
|
|
|
|
+ * from /ramfs/icons/apps96.icn; the panel is drawn into the WM shadow after
|
|
|
|
|
+ * the windows and is therefore an overlay, not a work-area reservation.
|
|
|
|
|
+ * The pointer's x distance to each base slot sets a smooth 1.0..1.75 scale;
|
|
|
|
|
+ * the scaled icons are laid out again and the row is recentred, which makes
|
|
|
|
|
+ * the magnified icons push their neighbours aside as the pointer moves. */
|
|
|
|
|
+static int dock_streq(const char *a, const char *b)
|
|
|
|
|
+{
|
|
|
|
|
+ while (*a && *a == *b) {
|
|
|
|
|
+ a++;
|
|
|
|
|
+ b++;
|
|
|
|
|
+ }
|
|
|
|
|
+ return *a == *b;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+static int dock_gap_size(void)
|
|
|
|
|
+{
|
|
|
|
|
+ if (fbw < 560)
|
|
|
|
|
+ return 4;
|
|
|
|
|
+ if (fbw < 760)
|
|
|
|
|
+ return 6;
|
|
|
|
|
+ return 10;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+static int dock_base_total(int base, int gap)
|
|
|
|
|
+{
|
|
|
|
|
+ int i, total = DOCK_N * base;
|
|
|
|
|
+
|
|
|
|
|
+ for (i = 0; i + 1 < DOCK_N; i++)
|
|
|
|
|
+ total += gap + (i == DOCK_N - 2 ? DOCK_SEP_GAP : 0);
|
|
|
|
|
+ return total;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+static int dock_base_size(int gap)
|
|
|
|
|
+{
|
|
|
|
|
+ int base = DOCK_BASE_MAX;
|
|
|
|
|
+
|
|
|
|
|
+ while (base > DOCK_BASE_MIN &&
|
|
|
|
|
+ dock_base_total(base, gap) + 2 * DOCK_PAD > (int)fbw)
|
|
|
|
|
+ base--;
|
|
|
|
|
+ return base;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+static int dock_gap_after(int i)
|
|
|
|
|
+{
|
|
|
|
|
+ return dock.gap + (i == DOCK_N - 2 ? DOCK_SEP_GAP : 0);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+/* The canvas title of a running app, or -1. The WM does not track an
|
|
|
|
|
+ * executable id, and a window title is the stable app identity the canvas
|
|
|
|
|
+ * ABI already carries. */
|
|
|
|
|
+static int app_window_index(const struct sm_app *a)
|
|
|
|
|
+{
|
|
|
|
|
+ int order[WM_MAX_WINDOWS];
|
|
|
|
|
+ unsigned int n = build_order(order), i;
|
|
|
|
|
+
|
|
|
|
|
+ if (!a->win_title)
|
|
|
|
|
+ return -1;
|
|
|
|
|
+ for (i = 0; i < n; i++) {
|
|
|
|
|
+ int idx = order[i];
|
|
|
|
|
+
|
|
|
|
|
+ if (wins[idx].info.used &&
|
|
|
|
|
+ dock_streq(wins[idx].info.title, a->win_title))
|
|
|
|
|
+ return idx;
|
|
|
|
|
+ }
|
|
|
|
|
+ return -1;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+static void dock_update(unsigned int mx, unsigned int my)
|
|
|
|
|
+{
|
|
|
|
|
+ int base, gap, i, bx, total, cursor;
|
|
|
|
|
+ int panel_top, max_extra, band_top, left, right;
|
|
|
|
|
+ int active, repaint = 0, moving = 0, still = 0;
|
|
|
|
|
+ int old_hover = dock_hover;
|
|
|
|
|
+
|
|
|
|
|
+ base = dock_base_size(dock_gap_size());
|
|
|
|
|
+ gap = dock_gap_size();
|
|
|
|
|
+ if (!dock_scale_ready) {
|
|
|
|
|
+ for (i = 0; i < DOCK_N; i++)
|
|
|
|
|
+ dock_scale[i] = DOCK_SCALE_ONE;
|
|
|
|
|
+ dock_scale_ready = 1;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /* Base slots: fixed centres, so the pointer does not chase a layout
|
|
|
|
|
+ * that is itself moving with the magnification. */
|
|
|
|
|
+ bx = (int)((fbw - (unsigned int)(dock_base_total(base, gap) +
|
|
|
|
|
+ 2 * DOCK_PAD)) / 2) + DOCK_PAD;
|
|
|
|
|
+ for (i = 0; i < DOCK_N; i++) {
|
|
|
|
|
+ dock.base_center[i] = bx + base / 2;
|
|
|
|
|
+ bx += base + (i + 1 < DOCK_N ? gap +
|
|
|
|
|
+ (i == DOCK_N - 2 ? DOCK_SEP_GAP : 0) : 0);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ panel_top = (int)fbh - DOCK_BOTTOM - (base + DOCK_PANEL_EXTRA);
|
|
|
|
|
+ max_extra = base * DOCK_SCALE_MAX / DOCK_SCALE_ONE - base;
|
|
|
|
|
+ band_top = panel_top - max_extra - DOCK_LABEL_GAP - 12;
|
|
|
|
|
+ if (band_top < WM_BAR_H)
|
|
|
|
|
+ band_top = WM_BAR_H;
|
|
|
|
|
+ left = (int)((fbw - (unsigned int)dock_base_total(base, gap)) / 2) -
|
|
|
|
|
+ base * 3;
|
|
|
|
|
+ right = left + dock_base_total(base, gap) + base * 6;
|
|
|
|
|
+ active = (int)my >= band_top && (int)my <= (int)fbh &&
|
|
|
|
|
+ (int)mx >= left && (int)mx <= right;
|
|
|
|
|
+ if (active != dock_active) {
|
|
|
|
|
+ dock_active = active;
|
|
|
|
|
+ repaint = 1;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ for (i = 0; i < DOCK_N; i++) {
|
|
|
|
|
+ int target = DOCK_SCALE_ONE;
|
|
|
|
|
+
|
|
|
|
|
+ if (active) {
|
|
|
|
|
+ int d = (int)mx - dock.base_center[i];
|
|
|
|
|
+ int reach = (base + gap) * 5 / 2;
|
|
|
|
|
+
|
|
|
|
|
+ if (d < 0)
|
|
|
|
|
+ d = -d;
|
|
|
|
|
+ if (d < reach) {
|
|
|
|
|
+ int w = (reach - d) * 256 / reach;
|
|
|
|
|
+
|
|
|
|
|
+ w = w * w / 256;
|
|
|
|
|
+ target = DOCK_SCALE_ONE +
|
|
|
|
|
+ ((DOCK_SCALE_MAX - DOCK_SCALE_ONE) *
|
|
|
|
|
+ w) / 256;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if (dock_scale[i] != target) {
|
|
|
|
|
+ int diff = target - (int)dock_scale[i];
|
|
|
|
|
+ int step = diff / 4;
|
|
|
|
|
+
|
|
|
|
|
+ if (!step)
|
|
|
|
|
+ step = diff > 0 ? 1 : -1;
|
|
|
|
|
+ dock_scale[i] = (unsigned short)((int)dock_scale[i] +
|
|
|
|
|
+ step);
|
|
|
|
|
+ diff = target - (int)dock_scale[i];
|
|
|
|
|
+ if (diff < 0)
|
|
|
|
|
+ diff = -diff;
|
|
|
|
|
+ if (diff <= 2)
|
|
|
|
|
+ dock_scale[i] = (unsigned short)target;
|
|
|
|
|
+ moving = 1;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (dock_scale[i] != target)
|
|
|
|
|
+ still = 1;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ dock.base = base;
|
|
|
|
|
+ dock.gap = gap;
|
|
|
|
|
+ dock.pad = DOCK_PAD;
|
|
|
|
|
+ dock.panel_h = base + DOCK_PANEL_EXTRA;
|
|
|
|
|
+ dock.panel_bottom = (int)fbh - DOCK_BOTTOM;
|
|
|
|
|
+ dock.panel_y = dock.panel_bottom - dock.panel_h;
|
|
|
|
|
+ dock.icon_bottom = dock.panel_bottom - DOCK_ICON_BOTTOM;
|
|
|
|
|
+
|
|
|
|
|
+ total = 2 * DOCK_PAD;
|
|
|
|
|
+ for (i = 0; i < DOCK_N; i++) {
|
|
|
|
|
+ dock.size[i] = (base * dock_scale[i] + DOCK_SCALE_ONE / 2) /
|
|
|
|
|
+ DOCK_SCALE_ONE;
|
|
|
|
|
+ total += dock.size[i];
|
|
|
|
|
+ if (i + 1 < DOCK_N)
|
|
|
|
|
+ total += dock_gap_after(i);
|
|
|
|
|
+ }
|
|
|
|
|
+ dock.panel_w = total;
|
|
|
|
|
+ dock.panel_x = (int)((fbw - (unsigned int)total) / 2);
|
|
|
|
|
+ cursor = dock.panel_x + DOCK_PAD;
|
|
|
|
|
+ for (i = 0; i < DOCK_N; i++) {
|
|
|
|
|
+ dock.x[i] = cursor;
|
|
|
|
|
+ dock.y[i] = dock.icon_bottom - dock.size[i];
|
|
|
|
|
+ cursor += dock.size[i];
|
|
|
|
|
+ if (i + 1 < DOCK_N)
|
|
|
|
|
+ cursor += dock_gap_after(i);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ dock_hover = -1;
|
|
|
|
|
+ for (i = 0; i < DOCK_N; i++) {
|
|
|
|
|
+ if ((int)mx >= dock.x[i] &&
|
|
|
|
|
+ (int)mx < dock.x[i] + dock.size[i] &&
|
|
|
|
|
+ (int)my >= dock.y[i] &&
|
|
|
|
|
+ (int)my < dock.y[i] + dock.size[i]) {
|
|
|
|
|
+ dock_hover = i;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if (dock_hover != old_hover)
|
|
|
|
|
+ repaint = 1;
|
|
|
|
|
+
|
|
|
|
|
+ dock.label_w = 0;
|
|
|
|
|
+ if (dock_hover >= 0) {
|
|
|
|
|
+ const struct sm_app *a = &sm_apps[dock_apps[dock_hover]];
|
|
|
|
|
+ int tw = (int)usurf_text_width(&screen, a->label);
|
|
|
|
|
+
|
|
|
|
|
+ dock.label_idx = dock_hover;
|
|
|
|
|
+ dock.label_w = tw + 20;
|
|
|
|
|
+ dock.label_h = DOCK_LABEL_H;
|
|
|
|
|
+ dock.label_x = dock.x[dock_hover] + dock.size[dock_hover] / 2 -
|
|
|
|
|
+ dock.label_w / 2;
|
|
|
|
|
+ if (dock.label_x < 4)
|
|
|
|
|
+ dock.label_x = 4;
|
|
|
|
|
+ if (dock.label_x + dock.label_w > (int)fbw - 4)
|
|
|
|
|
+ dock.label_x = (int)fbw - 4 - dock.label_w;
|
|
|
|
|
+ dock.label_y = dock.y[dock_hover] - DOCK_LABEL_GAP;
|
|
|
|
|
+ if (dock.label_y < WM_BAR_H + 2)
|
|
|
|
|
+ dock.label_y = WM_BAR_H + 2;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ dock.label_idx = -1;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ {
|
|
|
|
|
+ int x0 = dock.panel_x, y0 = dock.panel_y;
|
|
|
|
|
+ int x1 = dock.panel_x + dock.panel_w;
|
|
|
|
|
+ int y1 = dock.panel_bottom;
|
|
|
|
|
+
|
|
|
|
|
+ for (i = 0; i < DOCK_N; i++) {
|
|
|
|
|
+ if (dock.x[i] < x0)
|
|
|
|
|
+ x0 = dock.x[i];
|
|
|
|
|
+ if (dock.y[i] < y0)
|
|
|
|
|
+ y0 = dock.y[i];
|
|
|
|
|
+ if (dock.x[i] + dock.size[i] > x1)
|
|
|
|
|
+ x1 = dock.x[i] + dock.size[i];
|
|
|
|
|
+ if (dock.y[i] + dock.size[i] > y1)
|
|
|
|
|
+ y1 = dock.y[i] + dock.size[i];
|
|
|
|
|
+ }
|
|
|
|
|
+ if (dock.label_w) {
|
|
|
|
|
+ if (dock.label_x < x0)
|
|
|
|
|
+ x0 = dock.label_x;
|
|
|
|
|
+ if (dock.label_y < y0)
|
|
|
|
|
+ y0 = dock.label_y;
|
|
|
|
|
+ if (dock.label_x + dock.label_w > x1)
|
|
|
|
|
+ x1 = dock.label_x + dock.label_w;
|
|
|
|
|
+ if (dock.label_y + dock.label_h > y1)
|
|
|
|
|
+ y1 = dock.label_y + dock.label_h;
|
|
|
|
|
+ }
|
|
|
|
|
+ dock.visual.x = x0;
|
|
|
|
|
+ dock.visual.y = y0;
|
|
|
|
|
+ dock.visual.w = (unsigned int)(x1 - x0);
|
|
|
|
|
+ dock.visual.h = (unsigned int)(y1 - y0);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (moving) {
|
|
|
|
|
+ unsigned int now = u_ticks_ms();
|
|
|
|
|
+
|
|
|
|
|
+ /* The WM loop runs at 100 Hz; cap the magnification redraw at
|
|
|
|
|
+ * about 60 Hz, but always paint the frame that settles. */
|
|
|
|
|
+ if ((int)(now - dock_last_paint_ms) >= 16 || !still)
|
|
|
|
|
+ repaint = 1;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (repaint)
|
|
|
|
|
+ dock_dirty = 1;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+static void dock_draw(void)
|
|
|
|
|
+{
|
|
|
|
|
+ int i;
|
|
|
|
|
+
|
|
|
|
|
+ if (!dock.panel_w)
|
|
|
|
|
+ return;
|
|
|
|
|
+ /* A 1 px rim and a translucent interior; the WM shadow below already
|
|
|
|
|
+ * contains the wallpaper and windows, so this is a real overlay. */
|
|
|
|
|
+ usurf_fill_round_alpha(&screen, dock.panel_x, dock.panel_y,
|
|
|
|
|
+ dock.panel_w, dock.panel_h, 16,
|
|
|
|
|
+ 0x46506Cu, 190);
|
|
|
|
|
+ if (dock.panel_w > 2 && dock.panel_h > 2)
|
|
|
|
|
+ usurf_fill_round_alpha(&screen, dock.panel_x + 1,
|
|
|
|
|
+ dock.panel_y + 1, dock.panel_w - 2,
|
|
|
|
|
+ dock.panel_h - 2, 15,
|
|
|
|
|
+ 0x181C28u, 205);
|
|
|
|
|
+
|
|
|
|
|
+ {
|
|
|
|
|
+ int sx = dock.x[DOCK_N - 1] -
|
|
|
|
|
+ (dock.gap + DOCK_SEP_GAP) / 2;
|
|
|
|
|
+
|
|
|
|
|
+ usurf_fill_round_alpha(&screen, sx, dock.panel_y + 12, 1,
|
|
|
|
|
+ dock.panel_h - 24, 0, 0x5A6480u,
|
|
|
|
|
+ 120);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ for (i = 0; i < DOCK_N; i++) {
|
|
|
|
|
+ const struct sm_app *a = &sm_apps[dock_apps[i]];
|
|
|
|
|
+
|
|
|
|
|
+ if (!usurf_app_icon(&screen, dock.x[i], dock.y[i],
|
|
|
|
|
+ dock.size[i], (enum app_icon)a->icon))
|
|
|
|
|
+ sm_tile(dock.x[i], dock.y[i], dock.size[i],
|
|
|
|
|
+ a->tile, a->letter);
|
|
|
|
|
+ if (app_window_index(a) >= 0)
|
|
|
|
|
+ usurf_fill(&screen,
|
|
|
|
|
+ dock.x[i] + dock.size[i] / 2 - 2,
|
|
|
|
|
+ dock.panel_bottom - 6, 4, 4, 0xE8EAF6u);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (dock.label_w) {
|
|
|
|
|
+ const struct sm_app *a = &sm_apps[dock_apps[dock.label_idx]];
|
|
|
|
|
+
|
|
|
|
|
+ usurf_fill_round_alpha(&screen, dock.label_x, dock.label_y,
|
|
|
|
|
+ dock.label_w, dock.label_h, 8,
|
|
|
|
|
+ 0x10141Eu, 235);
|
|
|
|
|
+ usurf_text(&screen, dock.label_x + 10, dock.label_y + 5,
|
|
|
|
|
+ a->label, SM_TEXT, dock.label_x, dock.label_y,
|
|
|
|
|
+ (unsigned int)dock.label_w,
|
|
|
|
|
+ (unsigned int)dock.label_h);
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+static void dock_mark_drawn(void)
|
|
|
|
|
+{
|
|
|
|
|
+ dock_prev = dock.visual;
|
|
|
|
|
+ dock_prev_valid = 1;
|
|
|
|
|
+ dock_dirty = 0;
|
|
|
|
|
+ dock_last_paint_ms = u_ticks_ms();
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+static void dock_damage(struct wm_present_info *p)
|
|
|
|
|
+{
|
|
|
|
|
+ int x0, y0, x1, y1;
|
|
|
|
|
+
|
|
|
|
|
+ if (!dock.visual.w || !dock.visual.h)
|
|
|
|
|
+ return;
|
|
|
|
|
+ x0 = dock.visual.x;
|
|
|
|
|
+ y0 = dock.visual.y;
|
|
|
|
|
+ x1 = x0 + (int)dock.visual.w;
|
|
|
|
|
+ y1 = y0 + (int)dock.visual.h;
|
|
|
|
|
+ if (dock_prev_valid) {
|
|
|
|
|
+ if (dock_prev.x < x0)
|
|
|
|
|
+ x0 = dock_prev.x;
|
|
|
|
|
+ if (dock_prev.y < y0)
|
|
|
|
|
+ y0 = dock_prev.y;
|
|
|
|
|
+ if (dock_prev.x + (int)dock_prev.w > x1)
|
|
|
|
|
+ x1 = dock_prev.x + (int)dock_prev.w;
|
|
|
|
|
+ if (dock_prev.y + (int)dock_prev.h > y1)
|
|
|
|
|
+ y1 = dock_prev.y + (int)dock_prev.h;
|
|
|
|
|
+ }
|
|
|
|
|
+ add_rect(p, x0, y0, (unsigned int)(x1 - x0),
|
|
|
|
|
+ (unsigned int)(y1 - y0));
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+static int dock_icon_at(unsigned int mx, unsigned int my)
|
|
|
|
|
+{
|
|
|
|
|
+ int i;
|
|
|
|
|
+
|
|
|
|
|
+ for (i = 0; i < DOCK_N; i++) {
|
|
|
|
|
+ if ((int)mx >= dock.x[i] - 1 &&
|
|
|
|
|
+ (int)mx < dock.x[i] + dock.size[i] + 1 &&
|
|
|
|
|
+ (int)my >= dock.y[i] - 1 &&
|
|
|
|
|
+ (int)my < dock.y[i] + dock.size[i] + 1)
|
|
|
|
|
+ return i;
|
|
|
|
|
+ }
|
|
|
|
|
+ return -1;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+static int dock_pointer_inside(unsigned int mx, unsigned int my)
|
|
|
|
|
+{
|
|
|
|
|
+ if (dock_icon_at(mx, my) >= 0)
|
|
|
|
|
+ return 1;
|
|
|
|
|
+ if ((int)mx >= dock.panel_x &&
|
|
|
|
|
+ (int)mx < dock.panel_x + dock.panel_w &&
|
|
|
|
|
+ (int)my >= dock.panel_y &&
|
|
|
|
|
+ (int)my < dock.panel_bottom)
|
|
|
|
|
+ return 1;
|
|
|
|
|
+ if (dock.label_w &&
|
|
|
|
|
+ (int)mx >= dock.label_x &&
|
|
|
|
|
+ (int)mx < dock.label_x + dock.label_w &&
|
|
|
|
|
+ (int)my >= dock.label_y &&
|
|
|
|
|
+ (int)my < dock.label_y + dock.label_h)
|
|
|
|
|
+ return 1;
|
|
|
|
|
+ return 0;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+static void dock_activate(int idx)
|
|
|
|
|
+{
|
|
|
|
|
+ const struct sm_app *a = &sm_apps[dock_apps[idx]];
|
|
|
|
|
+ int win = app_window_index(a);
|
|
|
|
|
+
|
|
|
|
|
+ if (win >= 0 && u_wm_focus((unsigned int)win) == 0) {
|
|
|
|
|
+ full_redraw = 1;
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (a->action == SM_ACT_SETTINGS) {
|
|
|
|
|
+ open_control_panel();
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ sm_launch(dock_apps[idx]);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+static int dock_click_at(unsigned int mx, unsigned int my)
|
|
|
|
|
+{
|
|
|
|
|
+ int i = dock_icon_at(mx, my);
|
|
|
|
|
+
|
|
|
|
|
+ if (i >= 0) {
|
|
|
|
|
+ const struct sm_app *a = &sm_apps[dock_apps[i]];
|
|
|
|
|
+
|
|
|
|
|
+ if (!(a->action == SM_ACT_SETTINGS &&
|
|
|
|
|
+ app_window_index(a) >= 0))
|
|
|
|
|
+ dismiss_popover_outside(mx, my);
|
|
|
|
|
+ dock_activate(i);
|
|
|
|
|
+ return 1;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (dock_pointer_inside(mx, my)) {
|
|
|
|
|
+ dismiss_popover_outside(mx, my);
|
|
|
|
|
+ return 1;
|
|
|
|
|
+ }
|
|
|
|
|
+ return 0;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+static void dock_capture_update(unsigned int mx, unsigned int my,
|
|
|
|
|
+ unsigned int buttons)
|
|
|
|
|
+{
|
|
|
|
|
+ int inside;
|
|
|
|
|
+
|
|
|
|
|
+ /* A window drag/resize owns the pointer itself; do not touch its
|
|
|
|
|
+ * capture. */
|
|
|
|
|
+ if (resize_id >= 0 || drag_id >= 0) {
|
|
|
|
|
+ dock_captured = 0;
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ inside = dock_pointer_inside(mx, my);
|
|
|
|
|
+ if (inside && !dock_captured && buttons == 0) {
|
|
|
|
|
+ if (u_wm_mouse_capture(1) == 0)
|
|
|
|
|
+ dock_captured = 1;
|
|
|
|
|
+ } else if (!inside && dock_captured && buttons == 0) {
|
|
|
|
|
+ u_wm_mouse_capture(0);
|
|
|
|
|
+ dock_captured = 0;
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
/* Apply one edge-drag step. The grabbed edges follow the pointer while the
|
|
/* Apply one edge-drag step. The grabbed edges follow the pointer while the
|
|
|
* opposite edges stay put; the work area clamps the active edges. */
|
|
* opposite edges stay put; the work area clamps the active edges. */
|
|
|
static void resize_window_drag(struct uwin *u, unsigned int idx,
|
|
static void resize_window_drag(struct uwin *u, unsigned int idx,
|
|
@@ -2414,6 +2948,9 @@ static void update_cursor(unsigned int mx, unsigned int my)
|
|
|
|
|
|
|
|
want = (hit == SM_HIT_NONE || hit == SM_HIT_MENU) ?
|
|
want = (hit == SM_HIT_NONE || hit == SM_HIT_MENU) ?
|
|
|
CURSOR_DEFAULT : CURSOR_POINTER;
|
|
CURSOR_DEFAULT : CURSOR_POINTER;
|
|
|
|
|
+ } else if (dock_pointer_inside(mx, my)) {
|
|
|
|
|
+ want = dock_icon_at(mx, my) >= 0 ?
|
|
|
|
|
+ CURSOR_POINTER : CURSOR_DEFAULT;
|
|
|
} else if (my < WM_BAR_H) {
|
|
} else if (my < WM_BAR_H) {
|
|
|
if (bar_start_hit(mx, my) || bar_status_hit(mx, my))
|
|
if (bar_start_hit(mx, my) || bar_status_hit(mx, my))
|
|
|
want = CURSOR_POINTER;
|
|
want = CURSOR_POINTER;
|
|
@@ -2486,6 +3023,10 @@ static void handle_mouse(struct wm_status *st)
|
|
|
full_redraw = 1;
|
|
full_redraw = 1;
|
|
|
goto mouse_done;
|
|
goto mouse_done;
|
|
|
}
|
|
}
|
|
|
|
|
+ if (dock_click_at(mx, my)) {
|
|
|
|
|
+ last_title_id = -1;
|
|
|
|
|
+ goto mouse_done;
|
|
|
|
|
+ }
|
|
|
if (!bar_status_hit(mx, my))
|
|
if (!bar_status_hit(mx, my))
|
|
|
dismiss_popover_outside(mx, my);
|
|
dismiss_popover_outside(mx, my);
|
|
|
last_title_id = -1;
|
|
last_title_id = -1;
|
|
@@ -2640,6 +3181,7 @@ static void handle_mouse(struct wm_status *st)
|
|
|
u_wm_mouse_capture(0);
|
|
u_wm_mouse_capture(0);
|
|
|
}
|
|
}
|
|
|
mouse_done:
|
|
mouse_done:
|
|
|
|
|
+ dock_capture_update(mx, my, buttons);
|
|
|
prev_buttons = buttons;
|
|
prev_buttons = buttons;
|
|
|
update_cursor(mx, my);
|
|
update_cursor(mx, my);
|
|
|
}
|
|
}
|