mirror of
https://github.com/hyprwm/Hypr.git
synced 2024-11-22 13:35:57 +01:00
minor patches
This commit is contained in:
parent
57a85553ab
commit
be399a85b2
5 changed files with 12 additions and 34 deletions
|
@ -164,7 +164,7 @@ void CStatusBar::setupTray() {
|
||||||
XCB_CW_BACK_PIXEL | XCB_CW_BORDER_PIXEL | XCB_CW_OVERRIDE_REDIRECT | XCB_CW_COLORMAP,
|
XCB_CW_BACK_PIXEL | XCB_CW_BORDER_PIXEL | XCB_CW_OVERRIDE_REDIRECT | XCB_CW_COLORMAP,
|
||||||
values);
|
values);
|
||||||
|
|
||||||
xcb_atom_t dockAtom[] = {HYPRATOMS["_NET_WM_WINDOW_TYPE_UTILITY"]};
|
xcb_atom_t dockAtom[] = {HYPRATOMS["_NET_WM_WINDOW_TYPE_DOCK"]};
|
||||||
xcb_ewmh_set_wm_window_type(g_pWindowManager->EWMHConnection, m_iWindowID, 1, dockAtom);
|
xcb_ewmh_set_wm_window_type(g_pWindowManager->EWMHConnection, m_iWindowID, 1, dockAtom);
|
||||||
|
|
||||||
const uint32_t ORIENTATION = 0; // Horizontal
|
const uint32_t ORIENTATION = 0; // Horizontal
|
||||||
|
|
|
@ -620,27 +620,4 @@ void Events::eventClientMessage(xcb_generic_event_t* event) {
|
||||||
xcb_map_window(g_pWindowManager->DisplayConnection, CLIENT);
|
xcb_map_window(g_pWindowManager->DisplayConnection, CLIENT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void Events::eventConfigureRequest(xcb_generic_event_t* event) {
|
|
||||||
const auto E = reinterpret_cast<xcb_configure_request_event_t*>(event);
|
|
||||||
|
|
||||||
RETURNIFBAR;
|
|
||||||
|
|
||||||
const auto PWINDOW = g_pWindowManager->getWindowFromDrawable(E->window);
|
|
||||||
|
|
||||||
if (!PWINDOW || !PWINDOW->getIsFloating())
|
|
||||||
return;
|
|
||||||
|
|
||||||
// correct delta
|
|
||||||
auto DELTA = PWINDOW->getDefaultSize() - Vector2D(E->width, E->height);
|
|
||||||
|
|
||||||
PWINDOW->setDefaultSize(Vector2D(E->width, E->height));
|
|
||||||
PWINDOW->setDefaultPosition(PWINDOW->getDefaultPosition() - (DELTA / 2.f)); // Center
|
|
||||||
|
|
||||||
PWINDOW->setPosition(PWINDOW->getDefaultPosition());
|
|
||||||
PWINDOW->setSize(PWINDOW->getDefaultSize());
|
|
||||||
|
|
||||||
PWINDOW->setRealPosition(PWINDOW->getDefaultPosition());
|
|
||||||
PWINDOW->setRealSize(PWINDOW->getDefaultSize());
|
|
||||||
}
|
}
|
|
@ -16,7 +16,6 @@ namespace Events {
|
||||||
EVENT(KeyPress);
|
EVENT(KeyPress);
|
||||||
EVENT(MotionNotify);
|
EVENT(MotionNotify);
|
||||||
EVENT(ClientMessage);
|
EVENT(ClientMessage);
|
||||||
EVENT(ConfigureRequest);
|
|
||||||
|
|
||||||
// Bypass some events for floating windows
|
// Bypass some events for floating windows
|
||||||
CWindow* remapWindow(int, bool floating = false, int forcemonitor = -1);
|
CWindow* remapWindow(int, bool floating = false, int forcemonitor = -1);
|
||||||
|
|
|
@ -18,11 +18,10 @@ std::string exec(const char* cmd) {
|
||||||
|
|
||||||
void clearLogs() {
|
void clearLogs() {
|
||||||
std::ofstream logs;
|
std::ofstream logs;
|
||||||
const char* const ENVHOME = getenv("HOME");
|
const std::string DEBUGPATH = "/tmp/hypr/hypr.log";
|
||||||
const std::string DEBUGPATH = ENVHOME + (std::string) "/.hypr.log";
|
const std::string DEBUGPATH2 = "/tmp/hypr/hyprd.log";
|
||||||
logs.open(DEBUGPATH, std::ios::out | std::ios::trunc);
|
unlink(DEBUGPATH2.c_str());
|
||||||
logs << " ";
|
unlink(DEBUGPATH.c_str());
|
||||||
logs.close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
double parabolic(double from, double to, double incline) {
|
double parabolic(double from, double to, double incline) {
|
||||||
|
|
|
@ -264,10 +264,6 @@ void CWindowManager::recieveEvent() {
|
||||||
Events::eventMapWindow(ev);
|
Events::eventMapWindow(ev);
|
||||||
Debug::log(LOG, "Event dispatched MAP");
|
Debug::log(LOG, "Event dispatched MAP");
|
||||||
break;
|
break;
|
||||||
case XCB_CONFIGURE_REQUEST:
|
|
||||||
Events::eventConfigureRequest(ev);
|
|
||||||
Debug::log(LOG, "Event dispatched CONFIGURE_REQUEST");
|
|
||||||
break;
|
|
||||||
case XCB_BUTTON_PRESS:
|
case XCB_BUTTON_PRESS:
|
||||||
Events::eventButtonPress(ev);
|
Events::eventButtonPress(ev);
|
||||||
Debug::log(LOG, "Event dispatched BUTTON_PRESS");
|
Debug::log(LOG, "Event dispatched BUTTON_PRESS");
|
||||||
|
@ -1684,6 +1680,13 @@ void CWindowManager::doPostCreationChecks(CWindow* pWindow) {
|
||||||
}
|
}
|
||||||
free(wm_type_cookiereply);
|
free(wm_type_cookiereply);
|
||||||
|
|
||||||
|
// Check if it has a name
|
||||||
|
const auto NAME = getClassName(window);
|
||||||
|
if (NAME.first == "Error" && NAME.second == "Error") {
|
||||||
|
closeWindowAllChecks(window);
|
||||||
|
Debug::log(WARN, "Window created but has a class of NULL. Removing.");
|
||||||
|
}
|
||||||
|
|
||||||
Debug::log(LOG, "Post creation checks ended");
|
Debug::log(LOG, "Post creation checks ended");
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue