Skip to content

[DO NOT MERGE] GTK: Fix early exit from wxDropSource::DoDragDrop #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 35 commits into
base: coremail_stable
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
0dedc6c
Fix wxRibbonButtonBar's layout overall size computation.
Jun 16, 2023
232ec62
wxGTK: Fix UI refreshing delay when dragging the header border of gen…
Apr 29, 2024
cd69ca2
wxGTK: Fix improper wxEVT_LEAVE_WINDOW event
Apr 30, 2024
59e89f9
MacOSX: Change the two dummy messages to use systemUpTime as timestam…
Apr 29, 2024
69a24bc
MacOSX: Keep DoDragDrop() from re-entering to enable a proper working…
Apr 29, 2024
22513cf
wxOSX: Fix wxPopupTransientWindow's mouse event handling.
Apr 30, 2024
b678693
MacOSX: Make wxWebviewWebkit capture hotkeys less eagerly.
Apr 29, 2024
1167349
wxOSX: Add support for wxDropSource icons.
Apr 30, 2024
a48678d
wxOSX: Relax DoDragDrop() constraints.
Apr 30, 2024
33c801b
wxMSW: Optimize AlphaBlt.
Apr 30, 2024
4f22df0
wxGTK: Add private options to bring back traditional scrollbar(always…
Apr 30, 2024
be09c5f
Fix DND reordering of generic verion wxHeaderCtrl
May 9, 2024
ffa3bb7
Revert the old correct behavior that allow application to decide whet…
May 13, 2024
e3f8306
When the column header is dragged pass the leftmost/rightmost column,…
May 13, 2024
b968c7c
MacOS: Catch all exceptions thrown by wxCFEventLoop::OSXDoRun() for c…
May 31, 2024
dd0c776
Fix keyboard focus problem when embedd CEF window.
Jun 20, 2024
9f3e2cc
Fix wxRibbonButtonBar's layout overall size computation.
Jun 16, 2023
091ed36
wxGTK: Fix UI refreshing delay when dragging the header border of gen…
Apr 29, 2024
391aff4
wxGTK: Fix improper wxEVT_LEAVE_WINDOW event
Apr 30, 2024
3021cbc
MacOSX: Change the two dummy messages to use systemUpTime as timestam…
Apr 29, 2024
41a1e0c
MacOSX: Keep DoDragDrop() from re-entering to enable a proper working…
Apr 29, 2024
a92922d
wxOSX: Fix wxPopupTransientWindow's mouse event handling.
Apr 30, 2024
4647c3c
MacOSX: Make wxWebviewWebkit capture hotkeys less eagerly.
Apr 29, 2024
19f0511
wxOSX: Add support for wxDropSource icons.
Apr 30, 2024
b77c1b4
wxOSX: Relax DoDragDrop() constraints.
Apr 30, 2024
3341263
wxMSW: Optimize AlphaBlt.
Apr 30, 2024
0b638b0
wxGTK: Add private options to bring back traditional scrollbar(always…
Apr 30, 2024
d790ac3
Fix DND reordering of generic verion wxHeaderCtrl
May 9, 2024
9d94399
Revert the old correct behavior that allow application to decide whet…
May 13, 2024
5594ee3
When the column header is dragged pass the leftmost/rightmost column,…
May 13, 2024
2c3da0e
MacOS: Catch all exceptions thrown by wxCFEventLoop::OSXDoRun() for c…
May 31, 2024
a6efe6d
Fix keyboard focus problem when embedd CEF window.
Jun 20, 2024
6c13421
Merge branch 'coremail_stable' of https://github.com/Coremail/wxWidge…
coremail-cyt Jul 4, 2024
69dbef5
GTK: Fix wxGUIEventLoop::DoYieldFor compatibility when using with CEF
Jul 15, 2024
627420e
GTK: Fix early exit from `wxDropSource::DoDragDrop`
crml2024 Jul 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions include/wx/dnd.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ class WXDLLIMPEXP_CORE wxDropSourceBase
// give the default feedback
virtual bool GiveFeedback(wxDragResult WXUNUSED(effect)) { return false; }

protected:
const wxCursor& GetCursor(wxDragResult res) const
{
if ( res == wxDragCopy )
Expand All @@ -105,7 +104,8 @@ class WXDLLIMPEXP_CORE wxDropSourceBase
else
return m_cursorStop;
}


protected:
// the data we're dragging
wxDataObject *m_data;

Expand Down
13 changes: 11 additions & 2 deletions include/wx/generic/headerctrlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ class WXDLLIMPEXP_CORE wxHeaderCtrl : public wxHeaderCtrlBase


private:
enum class Region{
NoWhere,
LeftHalf,
RightHalf,
Separator
};
// implement base class pure virtuals
virtual void DoSetCount(unsigned int count) wxOVERRIDE;
virtual unsigned int DoGetCount() const wxOVERRIDE;
Expand Down Expand Up @@ -96,11 +102,14 @@ class WXDLLIMPEXP_CORE wxHeaderCtrl : public wxHeaderCtrlBase
// position is near the divider at the right end of this column (notice
// that this means that we return column 0 even if the position is over
// column 1 but close enough to the divider separating it from column 0)
unsigned int FindColumnAtPoint(int x, bool *onSeparator = NULL) const;
unsigned int FindColumnAtPoint(int x, Region& pos_region) const;

// return the result of FindColumnAtPoint() if it is a valid column,
// otherwise the index of the last (rightmost) displayed column
unsigned int FindColumnClosestToPoint(int xPhysical) const;
unsigned int FindColumnClosestToPoint(int xPhysical, Region& pos_region) const;

unsigned int FindColumnAfter(const unsigned int column_idx) const;
unsigned int FindColumnBefore(const unsigned int column_idx) const;

// return true if a drag resizing operation is currently in progress
bool IsResizing() const;
Expand Down
36 changes: 36 additions & 0 deletions include/wx/osx/cocoa/private/dnd.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#include "wx/wxprec.h"

#if wxUSE_DRAG_AND_DROP || wxUSE_CLIPBOARD

#ifndef WX_PRECOMP
#include "wx/object.h"
#endif

#include "wx/dnd.h"

#include "wx/osx/private.h"
#include "wx/osx/private/datatransfer.h"

@interface DropSourceDelegate : NSObject<NSDraggingSource>
{
BOOL dragFinished;
int resultCode;
wxDropSource* impl;

// Flags for drag and drop operations (wxDrag_* ).
int m_dragFlags;
NSImage* m_copy_cursor;
NSImage* m_move_cursor;
NSImage* m_none_cursor;
}

- (void)setImplementation:(nonnull wxDropSource *)dropSource flags:(int)flags;
- (BOOL)finished;
- (NSDragOperation)code;
- (NSDragOperation)draggingSession:(nonnull NSDraggingSession *)session sourceOperationMaskForDraggingContext:(NSDraggingContext)context;
- (void)draggedImage:(nonnull NSImage *)anImage movedTo:(NSPoint)aPoint;
- (void)draggedImage:(nonnull NSImage *)anImage endedAt:(NSPoint)aPoint operation:(NSDragOperation)operation;
- (nullable NSImage*)cursorForStatus:(wxDragResult)status;
@end

#endif
6 changes: 6 additions & 0 deletions include/wx/window.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@
#define wxUSE_MENUS_NATIVE wxUSE_MENUS
#endif // __WXUNIVERSAL__/!__WXUNIVERSAL__

#ifdef __WXGTK__
namespace CMExtension {
extern bool g_need_traditional_scrollbar;
}
#endif

// ----------------------------------------------------------------------------
// forward declarations
// ----------------------------------------------------------------------------
Expand Down
14 changes: 9 additions & 5 deletions src/common/popupcmn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -451,19 +451,23 @@ void wxPopupTransientWindow::OnIdle(wxIdleEvent& event)

if (IsShown() && m_child)
{
// Store the last mouse position to minimize the number of calls to
// wxFindWindowAtPoint() which are quite expensive.
// Store the last mouse position
static wxPoint s_posLast;
const wxPoint pos = wxGetMousePosition();
if ( pos != s_posLast )
{
s_posLast = pos;

wxWindow* const winUnderMouse = wxFindWindowAtPoint(pos);

// DO NOT use wxFindWindowAtPoint() because if there're multiple top level windows,
// it will 'Find the deepest window at the given mouse position in screen coordinates',
// which is not the right one for this logic.
auto screen_rect = GetScreenRect();
const auto mouse_within_me = (pos.x >= screen_rect.GetTopLeft().x and pos.y >= screen_rect.GetTopLeft().y and
pos.x <= screen_rect.GetBottomRight().x and pos.y <= screen_rect.GetBottomRight().y);

// We release the mouse capture while the mouse is inside the popup
// itself to allow using it normally with the controls inside it.
if ( wxGetTopLevelParent(winUnderMouse) == this )
if ( mouse_within_me )
{
if ( m_child->HasCapture() )
{
Expand Down
Loading