diff options
-rw-r--r-- | src/vdagent-x11-seamless-mode.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/vdagent-x11-seamless-mode.c b/src/vdagent-x11-seamless-mode.c index 1d5abaf..adc958c 100644 --- a/src/vdagent-x11-seamless-mode.c +++ b/src/vdagent-x11-seamless-mode.c @@ -132,6 +132,20 @@ get_window_type(Display *display, Window window) return None; } +/* Determine whether the window is popup. */ +static gboolean +is_popup(Display *display, Window window) +{ + Atom type, atom; + + type = get_window_type(display, window); + if (type == None) + return FALSE; + + atom = XInternAtom(display, "_NET_WM_WINDOW_TYPE_POPUP_MENU", 0); + return (type == atom); +} + static void get_geometry(Display *display, Window window, gint *x, gint *y, guint *w, guint *h) @@ -238,6 +252,35 @@ get_window_list(struct vdagent_x11 *x11, Window window) continue; } + /* Stupid hack for round corners */ + // TODO: Use only for GNOME? + if (!is_popup(x11->display, list[i])) { + SpiceWindow *window; + + window = g_new0(SpiceWindow, 1); + window->x = spice_window->x + 4; + window->y = spice_window->y; + window->w = spice_window->w - 8; + window->h = 1; + window_list = g_list_append(window_list, window); + + window = g_new0(SpiceWindow, 1); + window->x = spice_window->x + 2; + window->y = spice_window->y + 1; + window->w = spice_window->w - 4; + window->h = 1; + window_list = g_list_append(window_list, window); + + window = g_new0(SpiceWindow, 1); + window->x = spice_window->x + 1; + window->y = spice_window->y + 2; + window->w = spice_window->w - 2; + window->h = 2; + window_list = g_list_append(window_list, window); + + spice_window->y += 4; + spice_window->h -= 4; + } window_list = g_list_append(window_list, spice_window); } |