summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoel Klinghed <the_jk@opera.com>2020-07-17 15:33:53 +0200
committerJoel Klinghed <the_jk@opera.com>2020-07-17 15:33:53 +0200
commit7b459f749b317456c5c528ea7f44dfe5869fbfd0 (patch)
tree8570e878d93aee84e376ee84751be81e5d2e302e /src
parent2df36164c6dfaa4c1dfbd7bb652ff9837c8d912c (diff)
Let MonMon implementation set window title
Diffstat (limited to 'src')
-rw-r--r--src/icecc.cc4
-rw-r--r--src/monmon.cc5
-rw-r--r--src/monmon.hh2
3 files changed, 9 insertions, 2 deletions
diff --git a/src/icecc.cc b/src/icecc.cc
index 7982f7c..2b16267 100644
--- a/src/icecc.cc
+++ b/src/icecc.cc
@@ -37,6 +37,10 @@ public:
}
protected:
+ std::string title() const override {
+ return "MonMon";
+ }
+
void width_changed() override {
job_pattern_.reset();
}
diff --git a/src/monmon.cc b/src/monmon.cc
index 4335acb..ef341df 100644
--- a/src/monmon.cc
+++ b/src/monmon.cc
@@ -104,11 +104,12 @@ void MonMon::init(x::shared_connection const& conn, xcb_screen_t const* screen,
}
}
auto wm = ewmh->conn();
+ auto title_str = title();
if (wm) {
- xcb_ewmh_set_wm_name(wm, wnd_.get(), 6, "MonMon");
+ xcb_ewmh_set_wm_name(wm, wnd_.get(), title_str.size(), title_str.data());
} else {
xcb_icccm_set_wm_name(wnd_.conn(), wnd_.get(), XCB_ATOM_STRING, 8,
- 6, "MonMon");
+ title_str.size(), title_str.data());
}
xcb_create_gc(gcontext_.conn(), gcontext_.get(), wnd_.get(), 0, nullptr);
auto atom = atoms->get("WM_DELETE_WINDOW");
diff --git a/src/monmon.hh b/src/monmon.hh
index 05d58a5..0699f57 100644
--- a/src/monmon.hh
+++ b/src/monmon.hh
@@ -47,6 +47,8 @@ public:
protected:
MonMon(std::shared_ptr<PollLooper> const& looper);
+ virtual std::string title() const = 0;
+
virtual void width_changed() {
}