代码拉取完成,页面将自动刷新
同步操作将从 Jingling/kwin 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
/*
KWin - the KDE window manager
This file is part of the KDE project.
SPDX-FileCopyrightText: 2017 Martin Flöser <mgraesslin@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "moving_client_x11_filter.h"
#include "x11client.h"
#include "workspace.h"
#include <KKeyServer>
#include <xcb/xcb.h>
namespace KWin
{
MovingClientX11Filter::MovingClientX11Filter()
: X11EventFilter(QVector<int>{XCB_KEY_PRESS, XCB_MOTION_NOTIFY, XCB_BUTTON_PRESS, XCB_BUTTON_RELEASE})
{
}
bool MovingClientX11Filter::event(xcb_generic_event_t *event)
{
auto client = dynamic_cast<X11Client *>(workspace()->moveResizeClient());
if (!client) {
return false;
}
auto testWindow = [client, event] (xcb_window_t window) {
return client->moveResizeGrabWindow() == window && client->windowEvent(event);
};
const uint8_t eventType = event->response_type & ~0x80;
switch (eventType) {
case XCB_KEY_PRESS: {
int keyQt;
xcb_key_press_event_t *keyEvent = reinterpret_cast<xcb_key_press_event_t*>(event);
KKeyServer::xcbKeyPressEventToQt(keyEvent, &keyQt);
client->keyPressEvent(keyQt, keyEvent->time);
return true;
}
case XCB_BUTTON_PRESS:
case XCB_BUTTON_RELEASE:
return testWindow(reinterpret_cast<xcb_button_press_event_t*>(event)->event);
case XCB_MOTION_NOTIFY:
return testWindow(reinterpret_cast<xcb_motion_notify_event_t*>(event)->event);
}
return false;
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。