summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-08-26 14:21:14 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-08-26 14:21:14 (GMT)
commit19449e11ce0c163c0dc50659b0efae3b6a3d1d59 (patch)
tree15fc2fcb109a4bf6049351e9dd83933f8a512ae2
parent8da4f5d67d9f4b892a559456fc9ee9e91c72557b (diff)
parentbc1b481b1b3661958beec5f99e123d503749accb (diff)
downloadtk-19449e11ce0c163c0dc50659b0efae3b6a3d1d59.zip
tk-19449e11ce0c163c0dc50659b0efae3b6a3d1d59.tar.gz
tk-19449e11ce0c163c0dc50659b0efae3b6a3d1d59.tar.bz2
Merge 8.6
tkBind.c: button numbers are always positive
-rw-r--r--generic/tkBind.c6
-rw-r--r--macosx/tkMacOSXPrivate.h2
-rw-r--r--macosx/tkMacOSXSubwindows.c40
3 files changed, 11 insertions, 37 deletions
diff --git a/generic/tkBind.c b/generic/tkBind.c
index c87d8dd..c88c54b 100644
--- a/generic/tkBind.c
+++ b/generic/tkBind.c
@@ -5192,14 +5192,14 @@ GetPatternObj(
case ButtonPress:
case ButtonRelease:
assert(patPtr->info <= Button9);
- Tcl_AppendPrintfToObj(patternObj, "-%d", (int) patPtr->info);
+ Tcl_AppendPrintfToObj(patternObj, "-%u", (unsigned) patPtr->info);
break;
#if PRINT_SHORT_MOTION_SYNTAX
case MotionNotify: {
unsigned mask = patPtr->modMask;
while (mask & ALL_BUTTONS) {
- int button = ButtonNumberFromState(mask);
- Tcl_AppendPrintfToObj(patternObj, "-%d", button);
+ unsigned button = ButtonNumberFromState(mask);
+ Tcl_AppendPrintfToObj(patternObj, "-%u", button);
mask &= ~TkGetButtonMask(button);
}
break;
diff --git a/macosx/tkMacOSXPrivate.h b/macosx/tkMacOSXPrivate.h
index 3799afb..de95ca7 100644
--- a/macosx/tkMacOSXPrivate.h
+++ b/macosx/tkMacOSXPrivate.h
@@ -272,7 +272,7 @@ MODULE_SCOPE int TkMacOSXMakeFullscreen(TkWindow *winPtr,
MODULE_SCOPE void TkMacOSXEnterExitFullscreen(TkWindow *winPtr,
int active);
MODULE_SCOPE NSWindow* TkMacOSXDrawableWindow(Drawable drawable);
-MODULE_SCOPE NSView* TkMacOSXDrawableView(MacDrawable *macWin);
+#define TkMacOSXDrawableView(macWin) (NSView *)TkMacOSXGetRootControl((Drawable)(macWin))
MODULE_SCOPE void TkMacOSXWinCGBounds(TkWindow *winPtr, CGRect *bounds);
MODULE_SCOPE HIShapeRef TkMacOSXGetClipRgn(Drawable drawable);
MODULE_SCOPE void TkMacOSXInvalidateViewRegion(NSView *view,
diff --git a/macosx/tkMacOSXSubwindows.c b/macosx/tkMacOSXSubwindows.c
index 5564113..bbdb9a5 100644
--- a/macosx/tkMacOSXSubwindows.c
+++ b/macosx/tkMacOSXSubwindows.c
@@ -1145,14 +1145,15 @@ TkMacOSXGetDrawablePort(
*----------------------------------------------------------------------
*/
-NSView *
-TkMacOSXDrawableView(
- MacDrawable *macWin)
+void *
+TkMacOSXGetRootControl(
+ Drawable drawable)
{
- NSView *result = nil;
+ void *result = NULL;
+ MacDrawable *macWin = (MacDrawable *)drawable;
if (!macWin) {
- result = nil;
+ result = NULL;
} else if (!macWin->toplevel) {
result = macWin->view;
} else if (!(macWin->toplevel->flags & TK_EMBEDDED)) {
@@ -1161,7 +1162,7 @@ TkMacOSXDrawableView(
TkWindow *contWinPtr = TkpGetOtherWindow(macWin->toplevel->winPtr);
if (contWinPtr) {
- result = TkMacOSXDrawableView(contWinPtr->privatePtr);
+ result = TkMacOSXGetRootControl((Drawable)contWinPtr->privatePtr);
}
}
return result;
@@ -1170,33 +1171,6 @@ TkMacOSXDrawableView(
/*
*----------------------------------------------------------------------
*
- * TkMacOSXGetRootControl --
- *
- * This function returns the NSView for a given X drawable.
- *
- * Results:
- * A NSView* .
- *
- * Side effects:
- * None.
- *
- *----------------------------------------------------------------------
- */
-
-void *
-TkMacOSXGetRootControl(
- Drawable drawable)
-{
- /*
- * will probably need to fix this up for embedding
- */
-
- return TkMacOSXDrawableView((MacDrawable *) drawable);
-}
-
-/*
- *----------------------------------------------------------------------
- *
* TkMacOSXInvalClipRgns --
*
* This function invalidates the clipping regions for a given window and