1 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
4 # include "../config.h"
7 #include "appwidget.hh"
8 #include "application.hh"
17 AppWidget::AppWidget(Application *app, Direction direction,
18 Cursor cursor, int bevel_width)
19 : Widget(app, app->getStyle(), direction, cursor, bevel_width),
24 // set WM Protocols on the window
26 protocols[0] = Property::atoms.wm_protocols;
27 protocols[1] = Property::atoms.wm_delete_window;
28 XSetWMProtocols(**display, window(), protocols, 2);
33 AppWidget::~AppWidget()
37 void AppWidget::setStyle(RenderStyle *style)
39 Widget::setStyle(style);
41 setTexture(style->titlebarUnfocusBackground());
44 void AppWidget::show(void)
48 _application->_appwidget_count++;
51 void AppWidget::hide(void)
55 _application->_appwidget_count--;
58 void AppWidget::clientMessageHandler(const XClientMessageEvent &e)
60 EventHandler::clientMessageHandler(e);
61 if (e.message_type == Property::atoms.wm_protocols &&
62 static_cast<Atom>(e.data.l[0]) == Property::atoms.wm_delete_window)