mirror of
https://github.com/hyprwm/Hypr.git
synced 2024-11-02 06:45:58 +01:00
Merge pull request #19 from codic12/main
implement ewmh atom _NET_FRAME_EXTENTS
This commit is contained in:
commit
03ab2028a0
4 changed files with 22 additions and 4 deletions
|
@ -318,6 +318,7 @@ void parseLine(std::string& line) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigManager::loadConfigLoadVars() {
|
void ConfigManager::loadConfigLoadVars() {
|
||||||
|
const auto ORIGBORDERSIZE = configValues["border_size"].intValue;
|
||||||
Debug::log(LOG, "Reloading the config!");
|
Debug::log(LOG, "Reloading the config!");
|
||||||
ConfigManager::parseError = ""; // reset the error
|
ConfigManager::parseError = ""; // reset the error
|
||||||
ConfigManager::currentCategory = ""; // reset the category
|
ConfigManager::currentCategory = ""; // reset the category
|
||||||
|
@ -402,6 +403,8 @@ void ConfigManager::loadConfigLoadVars() {
|
||||||
|
|
||||||
loadBar = true;
|
loadBar = true;
|
||||||
isFirstLaunch = false;
|
isFirstLaunch = false;
|
||||||
|
|
||||||
|
if (ORIGBORDERSIZE != configValues["border_size"].intValue) EWMH::refreshAllExtents();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigManager::applyKeybindsToX() {
|
void ConfigManager::applyKeybindsToX() {
|
||||||
|
|
|
@ -420,6 +420,7 @@ void Events::eventMapWindow(xcb_generic_event_t* event) {
|
||||||
|
|
||||||
// EWMH
|
// EWMH
|
||||||
EWMH::updateClientList();
|
EWMH::updateClientList();
|
||||||
|
EWMH::setFrameExtents(E->window);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Events::eventButtonPress(xcb_generic_event_t* event) {
|
void Events::eventButtonPress(xcb_generic_event_t* event) {
|
||||||
|
|
|
@ -53,3 +53,15 @@ void EWMH::updateClientList() {
|
||||||
xcb_change_property(g_pWindowManager->DisplayConnection, XCB_PROP_MODE_REPLACE, g_pWindowManager->Screen->root, HYPRATOMS["_NET_CLIENT_LIST"], XCB_ATOM_WINDOW,
|
xcb_change_property(g_pWindowManager->DisplayConnection, XCB_PROP_MODE_REPLACE, g_pWindowManager->Screen->root, HYPRATOMS["_NET_CLIENT_LIST"], XCB_ATOM_WINDOW,
|
||||||
32, windowsList.size(), ArrWindowList);
|
32, windowsList.size(), ArrWindowList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EWMH::refreshAllExtents() {
|
||||||
|
for (auto& w : g_pWindowManager->windows)
|
||||||
|
if (w.getDrawable() > 0)
|
||||||
|
setFrameExtents(w.getDrawable());
|
||||||
|
}
|
||||||
|
|
||||||
|
void EWMH::setFrameExtents(xcb_window_t w) {
|
||||||
|
const auto BORDERSIZE = ConfigManager::getInt("border_size");
|
||||||
|
uint32_t extents[4] = {BORDERSIZE,BORDERSIZE,BORDERSIZE,BORDERSIZE};
|
||||||
|
xcb_change_property(g_pWindowManager->DisplayConnection, XCB_PROP_MODE_REPLACE, w, HYPRATOMS["_NET_FRAME_EXTENTS"], XCB_ATOM_CARDINAL, 32, 4, &extents);
|
||||||
|
}
|
||||||
|
|
|
@ -6,6 +6,8 @@ namespace EWMH {
|
||||||
void setupInitEWMH();
|
void setupInitEWMH();
|
||||||
void updateCurrentWindow(xcb_window_t);
|
void updateCurrentWindow(xcb_window_t);
|
||||||
void updateClientList();
|
void updateClientList();
|
||||||
|
void setFrameExtents(xcb_window_t);
|
||||||
|
void refreshAllExtents();
|
||||||
|
|
||||||
inline xcb_window_t EWMHwindow = 0;
|
inline xcb_window_t EWMHwindow = XCB_WINDOW_NONE;
|
||||||
};
|
};
|
Loading…
Reference in a new issue