#include "common.h"
#include "window.h"
#include "server.h"
+#include "panel.h"
send_event32 (win, server.atom._NET_WM_STATE, 2, server.atom._NET_WM_STATE_SHADED);
}
+/*
+int x11_send_expose(Display *dpy, Window dst, int x, int y, int width, int height)
+{
+ XEvent xe;
+ int rc;
+ xe.type = Expose;
+ xe.xexpose.window = dst;
+ xe.xexpose.x = x;
+ xe.xexpose.y = y;
+ xe.xexpose.width = width;
+ xe.xexpose.height = height;
+ xe.xexpose.count = 0;
+ rc = XSendEvent(tray_data.dpy, dst, True, NoEventMask, &xe);
+ return x11_ok() && rc != 0;
+}
+*/
int window_is_hidden (Window win)
{
Window window;
Atom *at;
int count, i;
-
+
if (XGetTransientForHint(server.dsp, win, &window) != 0) {
if (window) {
return 1;
}
at = server_get_property (win, server.atom._NET_WM_STATE, XA_ATOM, &count);
- for (i = 0; i < count; i++) {
+ for (i = 0; i < count; i++) {
if (at[i] == server.atom._NET_WM_STATE_SKIP_PAGER || at[i] == server.atom._NET_WM_STATE_SKIP_TASKBAR) {
XFree(at);
return 1;
return 1;
}
}
+ XFree(at);
+
+ for (i=0 ; i < nb_panel ; i++) {
+ if (panel1[i].main_win == win)
+ return 1;
+ }
// specification
// Windows with neither _NET_WM_WINDOW_TYPE nor WM_TRANSIENT_FOR set
// MUST be taken as top-level window.
- XFree(at);
return 0;
}
int window_get_desktop (Window win)
{
return get_property32(win, server.atom._NET_WM_DESKTOP, XA_CARDINAL);
-}
+}
int window_get_monitor (Window win)
int i, x, y;
Window src;
- XTranslateCoordinates(server.dsp, win, server.root_win, 0, 0, &x, &y, &src);
+ XTranslateCoordinates(server.dsp, win, server.root_win, 0, 0, &x, &y, &src);
+ x += 2;
+ y += 2;
for (i = 0; i < server.nb_monitor; i++) {
if (x >= server.monitor[i].x && x <= (server.monitor[i].x + server.monitor[i].width))
if (y >= server.monitor[i].y && y <= (server.monitor[i].y + server.monitor[i].height))
break;
}
-
+
//printf("window %lx : ecran %d, (%d, %d)\n", win, i, x, y);
if (i == server.nb_monitor) return 0;
else return i;
}
+int window_is_urgent (Window win)
+{
+ Atom *at;
+ int count, i;
+
+ at = server_get_property (win, server.atom._NET_WM_STATE, XA_ATOM, &count);
+ for (i = 0; i < count; i++) {
+ if (at[i] == server.atom._NET_WM_STATE_DEMANDS_ATTENTION) {
+ XFree(at);
+ return 1;
+ }
+ }
+ XFree(at);
+ return 0;
+}
+
+
int server_get_number_of_desktop ()
{
return get_property32(server.root_win, server.atom._NET_NUMBER_OF_DESKTOPS, XA_CARDINAL);
}
}
}
-
+
*iw = width[icon_num];
*ih = height[icon_num];
return icon_data[icon_num];
cairo_surface_t *cs = cairo_xlib_surface_create (server.dsp, pmap, server.visual, panel_height, panel_height);
cairo_t *c = cairo_create (cs);
-
+
PangoLayout *layout = pango_cairo_create_layout (c);
pango_layout_set_font_description (layout, font);
pango_layout_set_text (layout, text, len);
-
+
pango_layout_get_pixel_extents(layout, &rect_ink, &rect);
*height_ink = rect_ink.height;
*height = rect.height;
//printf("dimension : %d - %d\n", rect_ink.height, rect.height);
- g_object_unref (layout);
+ g_object_unref (layout);
cairo_destroy (c);
cairo_surface_destroy (cs);
XFreePixmap (server.dsp, pmap);