Skip to content

Commit

Permalink
Fixing errors in the Linux Implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
SySyAli committed Jan 4, 2024
1 parent 9fbb0b9 commit b54f6af
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions IWindowInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,11 @@ void WindowsTracker::startTracking()
#endif

#if __linux__
std::string getTrackingScreenOS(Display* display)
std::string getTrackingScreenLinux(Display* display)
{
Display* display = XOpenDisplay(nullptr);
if (!display) {
throw std::runtime_error("Cannot open display");
}
Window window;
char* title = nullptr;
int revert_to_return;
int status = XGetInputFocus(display, &window, &revert_to_return);

if (status == Success && window != None) {
Expand All @@ -126,7 +123,7 @@ void LinuxTracker::startTracking()
}

while (tracking) {
std::string title = getActiveWindowTitle(display);
std::string title = getTrackingScreenLinux(display);
char dt[26];
auto curTime = std::chrono::system_clock::now();
const std::time_t t_c = std::chrono::system_clock::to_time_t(curTime);
Expand Down

0 comments on commit b54f6af

Please sign in to comment.