Fractional-scale: move to new impl
This commit is contained in:
parent
ea95449402
commit
ea47e8c92a
9 changed files with 126 additions and 118 deletions
|
|
@ -1,17 +1,19 @@
|
|||
#include "ProtocolManager.hpp"
|
||||
|
||||
#include "../protocols/TearingControl.hpp"
|
||||
#include "../protocols/FractionalScale.hpp"
|
||||
|
||||
#include "xdg-output-unstable-v1-protocol.h"
|
||||
#include "tearing-control-v1.hpp"
|
||||
#include "fractional-scale-v1.hpp"
|
||||
|
||||
CProtocolManager::CProtocolManager() {
|
||||
m_pToplevelExportProtocolManager = std::make_unique<CToplevelExportProtocolManager>();
|
||||
m_pFractionalScaleProtocolManager = std::make_unique<CFractionalScaleProtocolManager>();
|
||||
m_pTextInputV1ProtocolManager = std::make_unique<CTextInputV1ProtocolManager>();
|
||||
m_pGlobalShortcutsProtocolManager = std::make_unique<CGlobalShortcutsProtocolManager>();
|
||||
m_pScreencopyProtocolManager = std::make_unique<CScreencopyProtocolManager>();
|
||||
|
||||
m_pXDGOutputProtocol = std::make_unique<CXDGOutputProtocol>(&zxdg_output_manager_v1_interface, 3, "XDGOutput");
|
||||
PROTO::tearing = std::make_unique<CTearingControlProtocol>(&wp_tearing_control_manager_v1_interface, 1, "TearingControl");
|
||||
PROTO::fractional = std::make_unique<CFractionalScaleProtocol>(&wp_fractional_scale_manager_v1_interface, 1, "FractionalScale");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
#include "../defines.hpp"
|
||||
#include "../protocols/ToplevelExport.hpp"
|
||||
#include "../protocols/FractionalScale.hpp"
|
||||
#include "../protocols/TextInputV1.hpp"
|
||||
#include "../protocols/GlobalShortcuts.hpp"
|
||||
#include "../protocols/Screencopy.hpp"
|
||||
|
|
@ -14,7 +13,6 @@ class CProtocolManager {
|
|||
|
||||
// TODO: rewrite to use the new protocol framework
|
||||
std::unique_ptr<CToplevelExportProtocolManager> m_pToplevelExportProtocolManager;
|
||||
std::unique_ptr<CFractionalScaleProtocolManager> m_pFractionalScaleProtocolManager;
|
||||
std::unique_ptr<CTextInputV1ProtocolManager> m_pTextInputV1ProtocolManager;
|
||||
std::unique_ptr<CGlobalShortcutsProtocolManager> m_pGlobalShortcutsProtocolManager;
|
||||
std::unique_ptr<CScreencopyProtocolManager> m_pScreencopyProtocolManager;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#include "SessionLockManager.hpp"
|
||||
#include "../Compositor.hpp"
|
||||
#include "../config/ConfigValue.hpp"
|
||||
#include "../protocols/FractionalScale.hpp"
|
||||
|
||||
static void handleSurfaceMap(void* owner, void* data) {
|
||||
const auto PSURFACE = (SSessionLockSurface*)owner;
|
||||
|
|
@ -74,7 +75,7 @@ void CSessionLockManager::onNewSessionLock(wlr_session_lock_v1* pWlrLock) {
|
|||
PSURFACE->pWlrLockSurface = PWLRSURFACE;
|
||||
PSURFACE->iMonitorID = PMONITOR->ID;
|
||||
|
||||
g_pProtocolManager->m_pFractionalScaleProtocolManager->setPreferredScaleForSurface(PSURFACE->pWlrLockSurface->surface, PMONITOR->scale);
|
||||
PROTO::fractional->sendScale(PSURFACE->pWlrLockSurface->surface, PMONITOR->scale);
|
||||
|
||||
wlr_session_lock_surface_v1_configure(PWLRSURFACE, PMONITOR->vecSize.x, PMONITOR->vecSize.y);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#include "InputMethodPopup.hpp"
|
||||
#include "InputManager.hpp"
|
||||
#include "../../Compositor.hpp"
|
||||
#include "../../protocols/FractionalScale.hpp"
|
||||
|
||||
CInputPopup::CInputPopup(wlr_input_popup_surface_v2* surf) : pWlr(surf) {
|
||||
surface.assign(surf->surface);
|
||||
|
|
@ -63,7 +64,7 @@ void CInputPopup::onMap() {
|
|||
if (!PMONITOR)
|
||||
return;
|
||||
|
||||
g_pProtocolManager->m_pFractionalScaleProtocolManager->setPreferredScaleForSurface(surface.wlr(), PMONITOR->scale);
|
||||
PROTO::fractional->sendScale(surface.wlr(), PMONITOR->scale);
|
||||
}
|
||||
|
||||
void CInputPopup::onUnmap() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue