Draw the drag icon
This commit is contained in:
parent
2ca834479f
commit
3e614f2c1e
10 changed files with 133 additions and 2 deletions
|
|
@ -20,11 +20,18 @@ void CInputManager::onMouseWarp(wlr_pointer_motion_absolute_event* e) {
|
|||
|
||||
void CInputManager::mouseMoveUnified(uint32_t time) {
|
||||
|
||||
// update stuff
|
||||
updateDragIcon();
|
||||
|
||||
|
||||
// focus
|
||||
wlr_surface* foundSurface = nullptr;
|
||||
Vector2D mouseCoords = getMouseCoordsInternal();
|
||||
|
||||
const auto PMONITOR = g_pCompositor->getMonitorFromCursor();
|
||||
if (PMONITOR)
|
||||
g_pCompositor->m_pLastMonitor = PMONITOR;
|
||||
|
||||
Vector2D surfaceCoords;
|
||||
Vector2D surfacePos = Vector2D(-1337, -1337);
|
||||
|
||||
|
|
@ -255,4 +262,19 @@ void CInputManager::onKeyboardMod(void* data, SKeyboard* pKeyboard) {
|
|||
|
||||
void CInputManager::refocus() {
|
||||
mouseMoveUnified(0);
|
||||
}
|
||||
|
||||
void CInputManager::updateDragIcon() {
|
||||
if (!g_pInputManager->m_sDrag.dragIcon)
|
||||
return;
|
||||
|
||||
switch (g_pInputManager->m_sDrag.dragIcon->drag->grab_type) {
|
||||
case WLR_DRAG_GRAB_KEYBOARD:
|
||||
break;
|
||||
case WLR_DRAG_GRAB_KEYBOARD_POINTER:
|
||||
g_pInputManager->m_sDrag.pos = g_pInputManager->getMouseCoordsInternal();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -24,11 +24,15 @@ public:
|
|||
|
||||
void setKeyboardLayout();
|
||||
|
||||
void updateDragIcon();
|
||||
|
||||
|
||||
// for dragging floating windows
|
||||
CWindow* currentlyDraggedWindow = nullptr;
|
||||
int dragButton = -1;
|
||||
|
||||
SDrag m_sDrag;
|
||||
|
||||
private:
|
||||
|
||||
std::list<SKeyboard> m_lKeyboards;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue