summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorKevin Walzer <kw@codebykevin.com>2015-04-07 01:12:45 (GMT)
committerKevin Walzer <kw@codebykevin.com>2015-04-07 01:12:45 (GMT)
commitccdac05dbacc3b62fc27a65c11c8bd1188daddf4 (patch)
tree95547ff6225666daa34552c1afc7ff7d112cc5a5 /generic
parente450f5762837d46e9c72791b8af7361838364291 (diff)
downloadtk-ccdac05dbacc3b62fc27a65c11c8bd1188daddf4.zip
tk-ccdac05dbacc3b62fc27a65c11c8bd1188daddf4.tar.gz
tk-ccdac05dbacc3b62fc27a65c11c8bd1188daddf4.tar.bz2
Further cleanup of scrolling, drawing, resize in Cocoa; thanks to Marc Culler for patches
Diffstat (limited to 'generic')
-rw-r--r--generic/tkCanvas.c13
-rw-r--r--generic/tkInt.decls3
-rw-r--r--generic/tkIntPlatDecls.h5
-rw-r--r--generic/tkTextDisp.c30
4 files changed, 32 insertions, 19 deletions
diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c
index 8e14852..9c4d60a 100644
--- a/generic/tkCanvas.c
+++ b/generic/tkCanvas.c
@@ -2447,6 +2447,19 @@ DisplayCanvas(
goto done;
}
+#ifdef MAC_OSX_TK
+ /*
+ * If drawing is disabled, all we need to do is
+ * clear the REDRAW_PENDING flag.
+ */
+ TkWindow *winPtr = (TkWindow *)(canvasPtr->tkwin);
+ MacDrawable *macWin = winPtr->privatePtr;
+ if (macWin && (macWin->flags & TK_DO_NOT_DRAW)){
+ canvasPtr->flags &= ~REDRAW_PENDING;
+ return;
+ }
+#endif
+
/*
* Choose a new current item if that is needed (this could cause event
* handlers to be invoked).
diff --git a/generic/tkInt.decls b/generic/tkInt.decls
index ebbadba..8924d68 100644
--- a/generic/tkInt.decls
+++ b/generic/tkInt.decls
@@ -1017,6 +1017,9 @@ declare 50 aqua {
declare 51 aqua {
void TkGenWMDestroyEvent(Tk_Window tkwin)
}
+declare 52 aqua {
+ TkMacOSXSetDrawingEnabled(TkWindow *winPtr, int flag);
+}
# removed duplicate from tkPlat table (tk.decls)
#declare 52 aqua {
diff --git a/generic/tkIntPlatDecls.h b/generic/tkIntPlatDecls.h
index 3a2a8aa..3a4bdac 100644
--- a/generic/tkIntPlatDecls.h
+++ b/generic/tkIntPlatDecls.h
@@ -250,7 +250,8 @@ EXTERN int TkGenerateButtonEvent(int x, int y, Window window,
unsigned int state);
/* 51 */
EXTERN void TkGenWMDestroyEvent(Tk_Window tkwin);
-/* Slot 52 is reserved */
+/* 52 */
+EXTERN void TkMacOSXSetDrawingEnabled(TkWindow *winPtr, int flag);
/* 53 */
EXTERN unsigned long TkpGetMS(void);
/* 54 */
@@ -395,7 +396,7 @@ typedef struct TkIntPlatStubs {
Window (*tkGetTransientMaster) (TkWindow *winPtr); /* 49 */
int (*tkGenerateButtonEvent) (int x, int y, Window window, unsigned int state); /* 50 */
void (*tkGenWMDestroyEvent) (Tk_Window tkwin); /* 51 */
- void (*reserved52)(void);
+ void (*tkMacOSXSetDrawingEnabled) (TkWindow *winPtr, int flag); /* 52 */
unsigned long (*tkpGetMS) (void); /* 53 */
void * (*tkMacOSXDrawable) (Drawable drawable); /* 54 */
int (*tkpScanWindowId) (Tcl_Interp *interp, const char *string, Window *idPtr); /* 55 */
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c
index 95ea935..c3bcd5e 100644
--- a/generic/tkTextDisp.c
+++ b/generic/tkTextDisp.c
@@ -3948,7 +3948,6 @@ DisplayText(
* warnings. */
Tcl_Interp *interp;
-
if ((textPtr->tkwin == NULL) || (textPtr->flags & DESTROYED)) {
/*
* The widget has been deleted. Don't do anything.
@@ -3957,6 +3956,19 @@ DisplayText(
return;
}
+#ifdef MAC_OSX_TK
+ /*
+ * If drawing is disabled, all we need to do is
+ * clear the REDRAW_PENDING flag.
+ */
+ TkWindow *winPtr = (TkWindow *)(textPtr->tkwin);
+ MacDrawable *macWin = winPtr->privatePtr;
+ if (macWin && (macWin->flags & TK_DO_NOT_DRAW)){
+ dInfoPtr->flags &= ~REDRAW_PENDING;
+ return;
+ }
+#endif
+
interp = textPtr->interp;
Tcl_Preserve(interp);
@@ -3964,14 +3976,6 @@ DisplayText(
Tcl_SetVar2(interp, "tk_textRelayout", NULL, "", TCL_GLOBAL_ONLY);
}
- if ((textPtr->tkwin == NULL) || (textPtr->flags & DESTROYED)) {
- /*
- * The widget has been deleted. Don't do anything.
- */
-
- goto end;
- }
-
if (!Tk_IsMapped(textPtr->tkwin) || (dInfoPtr->maxX <= dInfoPtr->x)
|| (dInfoPtr->maxY <= dInfoPtr->y)) {
UpdateDisplayInfo(textPtr);
@@ -3983,14 +3987,6 @@ DisplayText(
Tcl_SetVar2(interp, "tk_textRedraw", NULL, "", TCL_GLOBAL_ONLY);
}
- if ((textPtr->tkwin == NULL) || (textPtr->flags & DESTROYED)) {
- /*
- * The widget has been deleted. Don't do anything.
- */
-
- goto end;
- }
-
/*
* Choose a new current item if that is needed (this could cause event
* handlers to be invoked, hence the preserve/release calls and the loop,