summaryrefslogtreecommitdiffstats
path: root/macosx
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2019-08-27 13:17:48 (GMT)
committerfvogel <fvogelnew1@free.fr>2019-08-27 13:17:48 (GMT)
commitd4ee00e26e9b7ab6c7eb33ef4c8e1c29ff73aa1e (patch)
treee295994f0a263a25654b0876da32d581ce7d2875 /macosx
parent482d9e4c5ef3ed6c8c8c76a951274c9bb5b19748 (diff)
parentbb28b2120646b8a40cc8b82416f8836d4a6966ef (diff)
downloadtk-d4ee00e26e9b7ab6c7eb33ef4c8e1c29ff73aa1e.zip
tk-d4ee00e26e9b7ab6c7eb33ef4c8e1c29ff73aa1e.tar.gz
tk-d4ee00e26e9b7ab6c7eb33ef4c8e1c29ff73aa1e.tar.bz2
Merge change proposals from Jan Nijtmans, thanks!
Diffstat (limited to 'macosx')
-rw-r--r--macosx/tkMacOSXKeyEvent.c2
-rw-r--r--macosx/tkMacOSXMouseEvent.c14
-rw-r--r--macosx/tkMacOSXNotify.c2
-rw-r--r--macosx/tkMacOSXPort.h11
4 files changed, 20 insertions, 9 deletions
diff --git a/macosx/tkMacOSXKeyEvent.c b/macosx/tkMacOSXKeyEvent.c
index a7e6d10..f62e07c 100644
--- a/macosx/tkMacOSXKeyEvent.c
+++ b/macosx/tkMacOSXKeyEvent.c
@@ -538,7 +538,7 @@ XGrabKeyboard(
Time time)
{
keyboardGrabWinPtr = Tk_IdToWindow(display, grab_window);
- TkWindow *captureWinPtr = TkpGetCapture();
+ TkWindow *captureWinPtr = (TkWindow *) TkMacOSXGetCapture();
if (keyboardGrabWinPtr && captureWinPtr) {
NSWindow *w = TkMacOSXDrawableWindow(grab_window);
diff --git a/macosx/tkMacOSXMouseEvent.c b/macosx/tkMacOSXMouseEvent.c
index 5f11c20..074e36e 100644
--- a/macosx/tkMacOSXMouseEvent.c
+++ b/macosx/tkMacOSXMouseEvent.c
@@ -93,7 +93,7 @@ enum {
if (eventWindow) {
local = [theEvent locationInWindow];
global = [eventWindow tkConvertPointToScreen: local];
- tkwin = (Tk_Window) TkpGetCapture();
+ tkwin = TkMacOSXGetCapture();
if (tkwin) {
winPtr = (TkWindow *) tkwin;
eventWindow = TkMacOSXDrawableWindow(winPtr->window);
@@ -112,7 +112,7 @@ enum {
*/
global = [theEvent locationInWindow];
- tkwin = (Tk_Window) TkpGetCapture();
+ tkwin = TkMacOSXGetCapture();
if (tkwin) {
winPtr = (TkWindow *) tkwin;
eventWindow = TkMacOSXDrawableWindow(winPtr->window);
@@ -583,7 +583,7 @@ GenerateButtonEvent(
if ((medPtr->activeNonFloating == NULL)
|| ((!(TkpIsWindowFloating(medPtr->whichWin))
&& (medPtr->activeNonFloating != medPtr->whichWin))
- && TkpGetCapture() == NULL)) {
+ && TkMacOSXGetCapture() == NULL)) {
return false;
}
#endif
@@ -662,7 +662,7 @@ TkpSetCapture(
/*
*----------------------------------------------------------------------
*
- * TkpGetCapture --
+ * TkMacOSXGetCapture --
*
* Results:
* Returns the current grab window
@@ -673,10 +673,10 @@ TkpSetCapture(
*----------------------------------------------------------------------
*/
-TkWindow *
-TkpGetCapture(void)
+Tk_Window
+TkMacOSXGetCapture(void)
{
- return (TkWindow *) captureWinPtr;
+ return captureWinPtr;
}
/*
diff --git a/macosx/tkMacOSXNotify.c b/macosx/tkMacOSXNotify.c
index 535cd9e..7267b00 100644
--- a/macosx/tkMacOSXNotify.c
+++ b/macosx/tkMacOSXNotify.c
@@ -173,7 +173,7 @@ GetRunLoopMode(NSModalSession modalSession)
if (modalSession) {
runLoopMode = NSModalPanelRunLoopMode;
- } else if (TkpGetCapture()) {
+ } else if (TkMacOSXGetCapture()) {
runLoopMode = NSEventTrackingRunLoopMode;
}
if (!runLoopMode) {
diff --git a/macosx/tkMacOSXPort.h b/macosx/tkMacOSXPort.h
index 617abda..ca9f96a 100644
--- a/macosx/tkMacOSXPort.h
+++ b/macosx/tkMacOSXPort.h
@@ -128,6 +128,17 @@
#define TkpSync(display)
/*
+ * TkMacOSXGetCapture is a legacy function used on the Mac. When fixing
+ * [943d5ebe51], TkpGetCapture was added to the Windows port. Both
+ * are actually the same feature and should bear the same name. However,
+ * in order to avoid potential backwards incompatibilities, renaming
+ * TkMacOSXGetCapture into TkpGetCapture in *PlatDecls.h shall not be
+ * done in a patch release, therefore use a define here.
+ */
+
+#define TkpGetCapture TkMacOSXGetCapture
+
+/*
* This macro stores a representation of the window handle in a string.
*/