minor patches

This commit is contained in:
vaxerski 2021-12-19 00:47:58 +01:00
parent 57a85553ab
commit be399a85b2
5 changed files with 12 additions and 34 deletions

View file

@ -164,7 +164,7 @@ void CStatusBar::setupTray() {
XCB_CW_BACK_PIXEL | XCB_CW_BORDER_PIXEL | XCB_CW_OVERRIDE_REDIRECT | XCB_CW_COLORMAP,
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);
const uint32_t ORIENTATION = 0; // Horizontal

View file

@ -620,27 +620,4 @@ void Events::eventClientMessage(xcb_generic_event_t* event) {
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());
}

View file

@ -16,7 +16,6 @@ namespace Events {
EVENT(KeyPress);
EVENT(MotionNotify);
EVENT(ClientMessage);
EVENT(ConfigureRequest);
// Bypass some events for floating windows
CWindow* remapWindow(int, bool floating = false, int forcemonitor = -1);

View file

@ -18,11 +18,10 @@ std::string exec(const char* cmd) {
void clearLogs() {
std::ofstream logs;
const char* const ENVHOME = getenv("HOME");
const std::string DEBUGPATH = ENVHOME + (std::string) "/.hypr.log";
logs.open(DEBUGPATH, std::ios::out | std::ios::trunc);
logs << " ";
logs.close();
const std::string DEBUGPATH = "/tmp/hypr/hypr.log";
const std::string DEBUGPATH2 = "/tmp/hypr/hyprd.log";
unlink(DEBUGPATH2.c_str());
unlink(DEBUGPATH.c_str());
}
double parabolic(double from, double to, double incline) {

View file

@ -264,10 +264,6 @@ void CWindowManager::recieveEvent() {
Events::eventMapWindow(ev);
Debug::log(LOG, "Event dispatched MAP");
break;
case XCB_CONFIGURE_REQUEST:
Events::eventConfigureRequest(ev);
Debug::log(LOG, "Event dispatched CONFIGURE_REQUEST");
break;
case XCB_BUTTON_PRESS:
Events::eventButtonPress(ev);
Debug::log(LOG, "Event dispatched BUTTON_PRESS");
@ -1684,6 +1680,13 @@ void CWindowManager::doPostCreationChecks(CWindow* pWindow) {
}
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");
//
}