summaryrefslogtreecommitdiffstats
path: root/macosx
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2022-07-19 23:01:19 (GMT)
committerfvogel <fvogelnew1@free.fr>2022-07-19 23:01:19 (GMT)
commiteafc1baa9c6aed1d56baf456b84a5d2849b49be9 (patch)
tree3df9554cc03d1ed5f051b54cca07619a5fe1c565 /macosx
parent2aac8da53c318dfb1989cc1f9c68eed5a7988999 (diff)
parenta7e5bf30cd2bcd41110ef89203f4229e89d6e326 (diff)
downloadtk-eafc1baa9c6aed1d56baf456b84a5d2849b49be9.zip
tk-eafc1baa9c6aed1d56baf456b84a5d2849b49be9.tar.gz
tk-eafc1baa9c6aed1d56baf456b84a5d2849b49be9.tar.bz2
Fix [91ca777b4d]: ttk::notebook loose control over content of tabs on MacOS.
Diffstat (limited to 'macosx')
-rw-r--r--macosx/tkMacOSXPort.h8
-rw-r--r--macosx/tkMacOSXWm.c72
2 files changed, 2 insertions, 78 deletions
diff --git a/macosx/tkMacOSXPort.h b/macosx/tkMacOSXPort.h
index 2208b76..dbc9e2b 100644
--- a/macosx/tkMacOSXPort.h
+++ b/macosx/tkMacOSXPort.h
@@ -193,14 +193,6 @@ MODULE_SCOPE unsigned long TkMacOSXRGBPixel(unsigned long red, unsigned long gre
#define TkpGetPixel(p) (TkMacOSXRGBPixel(p->red >> 8, p->green >> 8, p->blue >> 8))
/*
- * Used by tkWindow.c
- */
-
-MODULE_SCOPE void TkMacOSXHandleMapOrUnmap(Tk_Window tkwin, XEvent *event);
-
-#define TkpHandleMapOrUnmap(tkwin, event) TkMacOSXHandleMapOrUnmap(tkwin, event)
-
-/*
* Used by tkAppInit
*/
diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c
index 1bf62d9..f8561bf 100644
--- a/macosx/tkMacOSXWm.c
+++ b/macosx/tkMacOSXWm.c
@@ -745,74 +745,6 @@ TkWmNewWindow(
/*
*----------------------------------------------------------------------
*
- * TkMacOSXHandleMapOrUnmap --
- *
- * The mechanism used by a geometry manager to propogate the information
- * about which of its content widgets are mapped is to call Tk_MapWindow
- * or Tk_UnmapNotify. Those functions generate MapNotify or UnmapNotify
- * events and then handle them immediately. Other platforms use
- * Tk_HandleEvent to do this. But that does not work correctly on macOS
- * due to the fact that the calls to Tk_MapNotify or Tk_UnmapNotify can
- * occur in display procedures which are being run in the drawRect method
- * of a TKContentView. The events will be processed after drawRect
- * returns, but they need to be processed immediately in some cases.
-
- * This function operates as a macOS alternative to Tk_HandleEvent, for
- * processing MapNotify or UnmapNotify events only. It is called by
- * Tk_MapWindow, Tk_UnmapWindow, TkWmMapWindow and TkWmUnmapWindow.
- * Rather than using Tk_HandleEvent it installs a filter which restricts
- * to the MapNotify or UnmapNotify events, it queues the event and then
- * processes window events with the filter installed. This allows the
- * event to be handled immediately even from within the drawRect method.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Handles a MapNotify or UnMapNotify event.
- *
- *----------------------------------------------------------------------
- */
-static Tk_RestrictAction
-MapUnmapRestrictProc(
- ClientData arg,
- XEvent *eventPtr)
-{
- return (eventPtr->type==MapNotify || eventPtr->type==UnmapNotify ?
- TK_PROCESS_EVENT : TK_DEFER_EVENT);
-}
-
-MODULE_SCOPE
-void TkMacOSXHandleMapOrUnmap(
- Tk_Window tkwin,
- XEvent *event)
-{
- ClientData oldArg;
- Tk_RestrictProc *oldProc;
- TkWindow *winPtr = (TkWindow *) tkwin;
- const Tk_GeomMgr *geomMgrPtr = winPtr->geomMgrPtr;
-
- /*
- * Sadly, this approach does not work with the "text" geometry manager.
- * The mysterious unexplained crash elicited by textDisp-5.2 occurs. So we
- * have to check for the "text" manager and revert to using Tk_HandleEvent
- * in that case. Hopefully this can be removed when the revised text
- * widget is in place.
- */
-
- if (geomMgrPtr && strcmp(geomMgrPtr->name, "text") == 0) {
- Tk_HandleEvent(event);
- return;
- }
- oldProc = Tk_RestrictEvents(MapUnmapRestrictProc, NULL, &oldArg);
- Tk_QueueWindowEvent(event, TCL_QUEUE_TAIL);
- while (Tcl_DoOneEvent(TCL_WINDOW_EVENTS|TCL_DONT_WAIT)) {}
- Tk_RestrictEvents(oldProc, oldArg, &oldArg);
-}
-
-/*
- *----------------------------------------------------------------------
- *
* TkWmMapWindow --
*
* This procedure is invoked to map a top-level window. This module gets
@@ -916,7 +848,7 @@ TkWmMapWindow(
event.xmap.type = MapNotify;
event.xmap.event = winPtr->window;
event.xmap.override_redirect = winPtr->atts.override_redirect;
- TkpHandleMapOrUnmap((Tk_Window)winPtr, &event);
+ Tk_HandleEvent(&event);
}
/*
@@ -952,7 +884,7 @@ TkWmUnmapWindow(
event.xunmap.from_configure = false;
winPtr->flags &= ~TK_MAPPED;
XUnmapWindow(winPtr->display, winPtr->window);
- TkpHandleMapOrUnmap((Tk_Window)winPtr, &event);
+ Tk_HandleEvent(&event);
}
/*