Changeset View
Changeset View
Standalone View
Standalone View
src/platforms/xcb/kwindowinfo.cpp
Show All 30 Lines | 22 | { | |||
---|---|---|---|---|---|
31 | return s_haveXRes; | 31 | return s_haveXRes; | ||
32 | } | 32 | } | ||
33 | 33 | | |||
34 | // KWindowSystem::info() should be updated too if something has to be changed here | 34 | // KWindowSystem::info() should be updated too if something has to be changed here | ||
35 | KWindowInfoPrivateX11::KWindowInfoPrivateX11(WId _win, NET::Properties properties, NET::Properties2 properties2) | 35 | KWindowInfoPrivateX11::KWindowInfoPrivateX11(WId _win, NET::Properties properties, NET::Properties2 properties2) | ||
36 | : KWindowInfoPrivate(_win, properties, properties2) | 36 | : KWindowInfoPrivate(_win, properties, properties2) | ||
37 | , KWindowInfoPrivateDesktopFileNameExtension() | 37 | , KWindowInfoPrivateDesktopFileNameExtension() | ||
38 | , KWindowInfoPrivatePidExtension() | 38 | , KWindowInfoPrivatePidExtension() | ||
39 | , KWindowInfoPrivateAppMenuExtension() | ||||
39 | { | 40 | { | ||
40 | installDesktopFileNameExtension(this); | 41 | installDesktopFileNameExtension(this); | ||
41 | installPidExtension(this); | 42 | installPidExtension(this); | ||
43 | installAppMenuExtension(this); | ||||
42 | 44 | | |||
43 | KXErrorHandler handler; | 45 | KXErrorHandler handler; | ||
44 | if (properties & NET::WMVisibleIconName) { | 46 | if (properties & NET::WMVisibleIconName) { | ||
45 | properties |= NET::WMIconName | NET::WMVisibleName; // force, in case it will be used as a fallback | 47 | properties |= NET::WMIconName | NET::WMVisibleName; // force, in case it will be used as a fallback | ||
46 | } | 48 | } | ||
47 | if (properties & NET::WMVisibleName) { | 49 | if (properties & NET::WMVisibleName) { | ||
48 | properties |= NET::WMName; // force, in case it will be used as a fallback | 50 | properties |= NET::WMName; // force, in case it will be used as a fallback | ||
49 | } | 51 | } | ||
▲ Show 20 Lines • Show All 395 Lines • ▼ Show 20 Line(s) | |||||
445 | #if !defined(KDE_NO_WARNING_OUTPUT) | 447 | #if !defined(KDE_NO_WARNING_OUTPUT) | ||
446 | if (!(m_info->passedProperties2() & NET::WM2DesktopFileName)) { | 448 | if (!(m_info->passedProperties2() & NET::WM2DesktopFileName)) { | ||
447 | qWarning() << "Pass NET::WM2DesktopFileName to KWindowInfo"; | 449 | qWarning() << "Pass NET::WM2DesktopFileName to KWindowInfo"; | ||
448 | } | 450 | } | ||
449 | #endif | 451 | #endif | ||
450 | return QByteArray(m_info->desktopFileName()); | 452 | return QByteArray(m_info->desktopFileName()); | ||
451 | } | 453 | } | ||
452 | 454 | | |||
455 | QByteArray KWindowInfoPrivateX11::applicationMenuObjectPath() const | ||||
456 | { | ||||
457 | #if !defined(KDE_NO_WARNING_OUTPUT) | ||||
458 | if (!(m_info->passedProperties2() & NET::WM2AppMenuObjectPath)) { | ||||
459 | qWarning() << "Pass NET::WM2AppMenuObjectPath to KWindowInfo"; | ||||
460 | } | ||||
461 | #endif | ||||
462 | return QByteArray(m_info->appMenuObjectPath()); | ||||
463 | } | ||||
464 | | ||||
465 | QByteArray KWindowInfoPrivateX11::applicationMenuServiceName() const | ||||
466 | { | ||||
467 | #if !defined(KDE_NO_WARNING_OUTPUT) | ||||
468 | if (!(m_info->passedProperties2() & NET::WM2AppMenuServiceName)) { | ||||
469 | qWarning() << "Pass NET::WM2AppMenuServiceName to KWindowInfo"; | ||||
470 | } | ||||
471 | #endif | ||||
472 | return QByteArray(m_info->appMenuServiceName()); | ||||
473 | } | ||||
474 | | ||||
453 | int KWindowInfoPrivateX11::pid() const | 475 | int KWindowInfoPrivateX11::pid() const | ||
454 | { | 476 | { | ||
455 | // If pid is found using the XRes extension use that instead. | 477 | // If pid is found using the XRes extension use that instead. | ||
456 | // It is more reliable than the app reporting it's own PID as apps | 478 | // It is more reliable than the app reporting it's own PID as apps | ||
457 | // within an app namespace are unable to do so correctly | 479 | // within an app namespace are unable to do so correctly | ||
458 | if (m_pid > 0) { | 480 | if (m_pid > 0) { | ||
459 | return m_pid; | 481 | return m_pid; | ||
460 | } | 482 | } | ||
Show All 9 Lines |