Changeset View
Changeset View
Standalone View
Standalone View
shell_client.cpp
Show First 20 Lines • Show All 708 Lines • ▼ Show 20 Line(s) | |||||
709 | } | 709 | } | ||
710 | 710 | | |||
711 | void ShellClient::closeWindow() | 711 | void ShellClient::closeWindow() | ||
712 | { | 712 | { | ||
713 | if (m_xdgShellSurface && isCloseable()) { | 713 | if (m_xdgShellSurface && isCloseable()) { | ||
714 | m_xdgShellSurface->close(); | 714 | m_xdgShellSurface->close(); | ||
715 | const qint32 pingSerial = static_cast<XdgShellInterface *>(m_xdgShellSurface->global())->ping(m_xdgShellSurface); | 715 | const qint32 pingSerial = static_cast<XdgShellInterface *>(m_xdgShellSurface->global())->ping(m_xdgShellSurface); | ||
716 | m_pingSerials.insert(pingSerial, PingReason::CloseWindow); | 716 | m_pingSerials.insert(pingSerial, PingReason::CloseWindow); | ||
717 | } else if (m_qtExtendedSurface && isCloseable()) { | | |||
718 | m_qtExtendedSurface->close(); | | |||
719 | } else if (m_internalWindow) { | 717 | } else if (m_internalWindow) { | ||
720 | m_internalWindow->hide(); | 718 | m_internalWindow->hide(); | ||
721 | } | 719 | } | ||
722 | } | 720 | } | ||
723 | 721 | | |||
724 | AbstractClient *ShellClient::findModal(bool allow_itself) | 722 | AbstractClient *ShellClient::findModal(bool allow_itself) | ||
725 | { | 723 | { | ||
726 | Q_UNUSED(allow_itself) | 724 | Q_UNUSED(allow_itself) | ||
727 | return nullptr; | 725 | return nullptr; | ||
728 | } | 726 | } | ||
729 | 727 | | |||
730 | bool ShellClient::isCloseable() const | 728 | bool ShellClient::isCloseable() const | ||
731 | { | 729 | { | ||
732 | if (m_windowType == NET::Desktop || m_windowType == NET::Dock) { | 730 | if (m_windowType == NET::Desktop || m_windowType == NET::Dock) { | ||
733 | return false; | 731 | return false; | ||
734 | } | 732 | } | ||
735 | if (m_xdgShellSurface) { | 733 | if (m_xdgShellSurface) { | ||
736 | return true; | 734 | return true; | ||
737 | } | 735 | } | ||
738 | if (m_internal) { | 736 | if (m_internal) { | ||
739 | return true; | 737 | return true; | ||
740 | } | 738 | } | ||
741 | return m_qtExtendedSurface ? true : false; | 739 | return false; | ||
742 | } | 740 | } | ||
743 | 741 | | |||
744 | bool ShellClient::isFullScreen() const | 742 | bool ShellClient::isFullScreen() const | ||
745 | { | 743 | { | ||
746 | return m_fullScreen; | 744 | return m_fullScreen; | ||
747 | } | 745 | } | ||
748 | 746 | | |||
749 | bool ShellClient::isMaximizable() const | 747 | bool ShellClient::isMaximizable() const | ||
▲ Show 20 Lines • Show All 695 Lines • ▼ Show 20 Line(s) | |||||
1445 | bool ShellClient::isInitialPositionSet() const | 1443 | bool ShellClient::isInitialPositionSet() const | ||
1446 | { | 1444 | { | ||
1447 | if (m_plasmaShellSurface) { | 1445 | if (m_plasmaShellSurface) { | ||
1448 | return m_plasmaShellSurface->isPositionSet(); | 1446 | return m_plasmaShellSurface->isPositionSet(); | ||
1449 | } | 1447 | } | ||
1450 | return false; | 1448 | return false; | ||
1451 | } | 1449 | } | ||
1452 | 1450 | | |||
1453 | void ShellClient::installQtExtendedSurface(QtExtendedSurfaceInterface *surface) | | |||
1454 | { | | |||
1455 | m_qtExtendedSurface = surface; | | |||
1456 | | ||||
1457 | connect(m_qtExtendedSurface.data(), &QtExtendedSurfaceInterface::raiseRequested, this, [this]() { | | |||
1458 | workspace()->raiseClientRequest(this); | | |||
1459 | }); | | |||
1460 | connect(m_qtExtendedSurface.data(), &QtExtendedSurfaceInterface::lowerRequested, this, [this]() { | | |||
1461 | workspace()->lowerClientRequest(this); | | |||
1462 | }); | | |||
1463 | m_qtExtendedSurface->installEventFilter(this); | | |||
1464 | } | | |||
1465 | | ||||
1466 | void ShellClient::installAppMenu(AppMenuInterface *menu) | 1451 | void ShellClient::installAppMenu(AppMenuInterface *menu) | ||
1467 | { | 1452 | { | ||
1468 | m_appMenuInterface = menu; | 1453 | m_appMenuInterface = menu; | ||
1469 | 1454 | | |||
1470 | auto updateMenu = [this](AppMenuInterface::InterfaceAddress address) { | 1455 | auto updateMenu = [this](AppMenuInterface::InterfaceAddress address) { | ||
1471 | updateApplicationMenuServiceName(address.serviceName); | 1456 | updateApplicationMenuServiceName(address.serviceName); | ||
1472 | updateApplicationMenuObjectPath(address.objectPath); | 1457 | updateApplicationMenuObjectPath(address.objectPath); | ||
1473 | }; | 1458 | }; | ||
▲ Show 20 Lines • Show All 522 Lines • Show Last 20 Lines |