mirror of
https://github.com/hyprwm/Hypr.git
synced 2024-11-26 06:45:58 +01:00
seems like i fixed the fucking flicker 🎉
This commit is contained in:
parent
085261c205
commit
0c842d35be
2 changed files with 8 additions and 9 deletions
|
@ -1,6 +1,6 @@
|
||||||
#include "events.hpp"
|
#include "events.hpp"
|
||||||
|
|
||||||
void handle(sigval val) {
|
void handle() {
|
||||||
g_pWindowManager->statusBar.draw();
|
g_pWindowManager->statusBar.draw();
|
||||||
|
|
||||||
// check config
|
// check config
|
||||||
|
@ -8,15 +8,13 @@ void handle(sigval val) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Events::setThread() {
|
void Events::setThread() {
|
||||||
sigevent eventsig;
|
|
||||||
eventsig.sigev_notify = SIGEV_THREAD;
|
|
||||||
eventsig.sigev_notify_function = handle;
|
|
||||||
eventsig.sigev_notify_attributes = NULL;
|
|
||||||
eventsig.sigev_value.sival_ptr = &timerid;
|
|
||||||
timer_create(CLOCK_REALTIME, &eventsig, &timerid);
|
|
||||||
|
|
||||||
itimerspec t = {{0, 1000 * (1000 / ConfigManager::getInt("max_fps"))}, {1, 0}};
|
g_pWindowManager->barThread = new std::thread([&]() {
|
||||||
timer_settime(timerid, 0, &t, 0);
|
for (;;) {
|
||||||
|
handle();
|
||||||
|
std::this_thread::sleep_for(std::chrono::milliseconds(1000 / ConfigManager::getInt("max_fps")));
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void Events::eventEnter(xcb_generic_event_t* event) {
|
void Events::eventEnter(xcb_generic_event_t* event) {
|
||||||
|
|
|
@ -31,6 +31,7 @@ public:
|
||||||
CWorkspace* activeWorkspace = nullptr;
|
CWorkspace* activeWorkspace = nullptr;
|
||||||
|
|
||||||
CStatusBar statusBar;
|
CStatusBar statusBar;
|
||||||
|
std::thread* barThread;
|
||||||
|
|
||||||
CWindow* getWindowFromDrawable(xcb_drawable_t);
|
CWindow* getWindowFromDrawable(xcb_drawable_t);
|
||||||
void addWindowToVectorSafe(CWindow);
|
void addWindowToVectorSafe(CWindow);
|
||||||
|
|
Loading…
Reference in a new issue