mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-09-30 13:30:28 -05:00
fix for certain window names not being detected
This commit is contained in:
@@ -150,7 +150,9 @@ static std::string GetWindowTitle(size_t i)
|
|||||||
std::string windowTitle;
|
std::string windowTitle;
|
||||||
char* name;
|
char* name;
|
||||||
|
|
||||||
int status = XFetchName(disp(), w, &name);
|
XTextProperty text;
|
||||||
|
int status = XGetWMName(disp(), w, &text);
|
||||||
|
name = reinterpret_cast<char*>(text.value);
|
||||||
if (status >= Success && name != nullptr)
|
if (status >= Success && name != nullptr)
|
||||||
{
|
{
|
||||||
std::string str(name);
|
std::string str(name);
|
||||||
@@ -201,7 +203,9 @@ void GetCurrentWindowTitle(string &title)
|
|||||||
&bytes,
|
&bytes,
|
||||||
(uint8_t**)&data);
|
(uint8_t**)&data);
|
||||||
|
|
||||||
int status = XFetchName(disp(), data[0], &name);
|
XTextProperty text;
|
||||||
|
int status = XGetWMName(disp(), data[0], &text);
|
||||||
|
name = reinterpret_cast<char*>(text.value);
|
||||||
|
|
||||||
if (status >= Success && name != nullptr) {
|
if (status >= Success && name != nullptr) {
|
||||||
std::string str(name);
|
std::string str(name);
|
||||||
@@ -319,5 +323,3 @@ int secondsSinceLastInput()
|
|||||||
|
|
||||||
return idle_time;
|
return idle_time;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user