parent
eddda10c23
commit
d5587bf6f6
@ -1,5 +1,4 @@
|
|||||||
#include <xcb/xcb.h>
|
#include <xcb/xcb.h>
|
||||||
#include <xcb/xcb_icccm.h>
|
|
||||||
#include <i3ipc++/ipc.hpp>
|
#include <i3ipc++/ipc.hpp>
|
||||||
|
|
||||||
#include "common.hpp"
|
#include "common.hpp"
|
||||||
@ -8,6 +7,7 @@
|
|||||||
#include "utils/socket.hpp"
|
#include "utils/socket.hpp"
|
||||||
#include "utils/string.hpp"
|
#include "utils/string.hpp"
|
||||||
#include "x11/connection.hpp"
|
#include "x11/connection.hpp"
|
||||||
|
#include "x11/icccm.hpp"
|
||||||
|
|
||||||
POLYBAR_NS
|
POLYBAR_NS
|
||||||
|
|
||||||
@ -20,20 +20,12 @@ namespace i3_util {
|
|||||||
auto children = conn.query_tree(conn.screen()->root).children();
|
auto children = conn.query_tree(conn.screen()->root).children();
|
||||||
|
|
||||||
for (auto it = children.begin(); it != children.end(); it++) {
|
for (auto it = children.begin(); it != children.end(); it++) {
|
||||||
xcb_icccm_get_text_property_reply_t reply;
|
auto wm_name = icccm_util::get_wm_name(conn, *it);
|
||||||
reply.name = nullptr;
|
if (wm_name.compare("[i3 con] output " + output_name) == 0) {
|
||||||
|
|
||||||
if (xcb_icccm_get_wm_name_reply(conn, xcb_icccm_get_wm_name(conn, *it), &reply, nullptr)) {
|
|
||||||
if (("[i3 con] output " + output_name).compare(0, 16 + output_name.length(), reply.name) == 0) {
|
|
||||||
roots.emplace_back(*it);
|
roots.emplace_back(*it);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reply.name != nullptr) {
|
|
||||||
xcb_icccm_get_text_property_reply_wipe(&reply);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return roots;
|
return roots;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -47,10 +39,7 @@ namespace i3_util {
|
|||||||
for (auto&& root : root_windows(conn, mon->name)) {
|
for (auto&& root : root_windows(conn, mon->name)) {
|
||||||
const uint32_t value_mask = XCB_CONFIG_WINDOW_SIBLING | XCB_CONFIG_WINDOW_STACK_MODE;
|
const uint32_t value_mask = XCB_CONFIG_WINDOW_SIBLING | XCB_CONFIG_WINDOW_STACK_MODE;
|
||||||
const uint32_t value_list[2]{root, XCB_STACK_MODE_ABOVE};
|
const uint32_t value_list[2]{root, XCB_STACK_MODE_ABOVE};
|
||||||
|
|
||||||
conn.configure_window_checked(win, value_mask, value_list);
|
conn.configure_window_checked(win, value_mask, value_list);
|
||||||
conn.flush();
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user