[PR #365] [MERGED] CtrlCore: update mouse pos when receving DnD event on macOS. #345

Closed
opened 2026-05-05 03:46:21 -06:00 by gitea-mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ultimatepp/ultimatepp/pull/365
Author: @klugier
Created: 1/28/2026
Status: Merged
Merged: 1/28/2026
Merged by: @mirek-fidler

Base: masterHead: klugier/update-mouse-pos-when-dnd-event-macos


📝 Commits (1)

  • 2337947 CtrlCore: update mouse pos when receving DnD event on macOS.

📊 Changes

1 file changed (+3 additions, -2 deletions)

View changed files

📝 uppsrc/CtrlCore/CocoProc.mm (+3 -2)

📄 Description

Global mouse pos value needs to be updated when receving drag and drop event. Otherwise, there are problem in some controls for example TabBar.

Here is the code that is broken under the current implementation (TabBar.cpp)

		// Draw transparent drag image
		Point mouse = GetMousePos() - GetScreenRect().TopLeft(); // <- Wrong value without fix (pre drag value)
		Size isz = dragtab.GetSize();
		int p = 0;
		int sep = DPI(TB_SBSEPARATOR) * sc.IsVisible();
		
		int top = drag == active ? st.sel.bottom : st.sel.top;
		if (align == BOTTOM || align == RIGHT)
			p = int(drag == active) * -top + sep;
		else
			p = int(drag != active) * top;
		
		if (IsHorz())
			w.DrawImage(mouse.x - isz.cx / 2, p, isz.cx, isz.cy, dragtab);
		else
			w.DrawImage(p, mouse.y - isz.cy / 2, isz.cx, isz.cy, dragtab);

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ultimatepp/ultimatepp/pull/365 **Author:** [@klugier](https://github.com/klugier) **Created:** 1/28/2026 **Status:** ✅ Merged **Merged:** 1/28/2026 **Merged by:** [@mirek-fidler](https://github.com/mirek-fidler) **Base:** `master` ← **Head:** `klugier/update-mouse-pos-when-dnd-event-macos` --- ### 📝 Commits (1) - [`2337947`](https://github.com/ultimatepp/ultimatepp/commit/2337947f2fc2937aaf9c83c2ab1cad1aa865d9e5) CtrlCore: update mouse pos when receving DnD event on macOS. ### 📊 Changes **1 file changed** (+3 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `uppsrc/CtrlCore/CocoProc.mm` (+3 -2) </details> ### 📄 Description Global mouse pos value needs to be updated when receving drag and drop event. Otherwise, there are problem in some controls for example TabBar. Here is the code that is broken under the current implementation (TabBar.cpp) ``` // Draw transparent drag image Point mouse = GetMousePos() - GetScreenRect().TopLeft(); // <- Wrong value without fix (pre drag value) Size isz = dragtab.GetSize(); int p = 0; int sep = DPI(TB_SBSEPARATOR) * sc.IsVisible(); int top = drag == active ? st.sel.bottom : st.sel.top; if (align == BOTTOM || align == RIGHT) p = int(drag == active) * -top + sep; else p = int(drag != active) * top; if (IsHorz()) w.DrawImage(mouse.x - isz.cx / 2, p, isz.cx, isz.cy, dragtab); else w.DrawImage(p, mouse.y - isz.cy / 2, isz.cx, isz.cy, dragtab); ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
gitea-mirror 2026-05-05 03:46:21 -06:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/ultimatepp#345
No description provided.