Set WM_WINDOW_ROLE for fluxbox windows

This commit is contained in:
Vladimir A. Pavlov 2012-10-22 19:39:35 +04:00 committed by Mathias Gumz
parent 7a404e7fbc
commit 36489e4a17
6 changed files with 15 additions and 0 deletions

View file

@ -33,6 +33,7 @@ FbMenu::FbMenu(FbTk::ThemeProxy<FbTk::MenuTheme> &tm,
FbTk::Menu(tm, imgctrl),
m_layeritem(fbwindow(), layer) {
fbwindow().setWindowRole("fluxbox-menu");
}
void FbMenu::buttonPressEvent(XButtonEvent &be) {

View file

@ -265,6 +265,13 @@ void FbWindow::setName(const char *name) {
XStoreName(display(), m_window, name);
}
void FbWindow::setWindowRole(const char *windowRole) {
XTextProperty tp;
XStringListToTextProperty(const_cast<char **>(&windowRole), 1, &tp);
XSetTextProperty(display(), m_window, &tp, XInternAtom(display(), "WM_WINDOW_ROLE", False));
XFree(tp.value);
}
void FbWindow::setEventMask(long mask) {
XSelectInput(display(), m_window, mask);
}

View file

@ -87,6 +87,8 @@ public:
virtual void setBorderWidth(unsigned int size);
/// set window name ("title")
void setName(const char *name);
/// set window role
void setWindowRole(const char *windowRole);
void setEventMask(long mask);
/// clear window with background pixmap or color
virtual void clear();

View file

@ -262,6 +262,8 @@ Slit::Slit(BScreen &scr, FbTk::Layer &layer, const char *filename)
_FB_USES_NLS;
frame.window.setWindowRole("fluxbox-slit");
// attach to theme and root window change signal
join(theme().reconfigSig(), FbTk::MemFun(*this, &Slit::reconfigure));

View file

@ -50,6 +50,7 @@ TextDialog::TextDialog(BScreen &screen,
m_move_x(0),
m_move_y(0),
m_pixmap(0){
setWindowRole("fluxbox-dialog-text");
init();
}

View file

@ -225,6 +225,8 @@ Toolbar::Toolbar(BScreen &scrn, FbTk::Layer &layer, size_t width):
m_resize_lock(false) {
_FB_USES_NLS;
frame.window.setWindowRole("fluxbox-toolbar");
// get this on antialias change
m_signal_tracker.join(screen().reconfigureSig(),
FbTk::MemFunIgnoreArgs(*this, &Toolbar::reconfigure));