diff --git a/src/SNI.cpp b/src/SNI.cpp index 53e134a..13cef59 100644 --- a/src/SNI.cpp +++ b/src/SNI.cpp @@ -11,6 +11,7 @@ #include #include +#include #include namespace SNI @@ -152,10 +153,31 @@ namespace SNI { LOG("SNI: Error querying tooltip"); } - LOG("SNI: Title: " << data->item.tooltip); + LOG("SNI: Tooltip: " << data->item.tooltip); g_variant_unref(tooltip); } + if (data->item.tooltip.empty()) + { + LOG("SNI: No tooltip found, using title as tooltip"); + // No tooltip, use title as tooltip + GVariant* title = getProperty("Title"); + if (title) + { + const gchar* titleStr = g_variant_get_string(title, nullptr); + if (titleStr != nullptr) + { + data->item.tooltip = titleStr; + } + else + { + LOG("SNI: Error querying title"); + } + LOG("SNI: Fallback tooltip: " << data->item.tooltip); + g_variant_unref(title); + } + } + // Query menu GVariant* menuPath = getProperty("Menu"); if (menuPath)