summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXNotify.c
diff options
context:
space:
mode:
authorculler <culler>2020-05-06 21:45:15 (GMT)
committerculler <culler>2020-05-06 21:45:15 (GMT)
commitc735d5a4eccde22cdc2eded757bed8b728607427 (patch)
tree4262349656d4b98df6adf7a84698ded6d28b7019 /macosx/tkMacOSXNotify.c
parent2ba6bd562b5ebdda1b68d6ea1e00defe7486801f (diff)
downloadtk-c735d5a4eccde22cdc2eded757bed8b728607427.zip
tk-c735d5a4eccde22cdc2eded757bed8b728607427.tar.gz
tk-c735d5a4eccde22cdc2eded757bed8b728607427.tar.bz2
Work around an Apple bug which causes *Warning: Window move completed without beginning.* to be sent to stderr.
Diffstat (limited to 'macosx/tkMacOSXNotify.c')
-rw-r--r--macosx/tkMacOSXNotify.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/macosx/tkMacOSXNotify.c b/macosx/tkMacOSXNotify.c
index afee942..77e9e74 100644
--- a/macosx/tkMacOSXNotify.c
+++ b/macosx/tkMacOSXNotify.c
@@ -141,12 +141,47 @@ void DebugPrintQueue(void)
*/
- (void) sendEvent: (NSEvent *) theEvent
{
+
+ /*
+ * Workaround for an Apple bug. When an accented character is selected
+ * from an NSTextInputClient popup character viewer with the mouse, Apple
+ * sends an event of type NSEventTypeAppKitDefined and subtype 21. If that
+ * event is sent up the responder chain it causes Apple to print a warning
+ * to the console log and, extremely obnoxiously, also to stderr, which
+ * says "Window move completed without beginning." Apparently they are
+ * sending the "move completed" event without having sent the "move began"
+ * event of subtype 20, and then announcing their error on our stderr.
+ * Also, of course, no movement is occurring. The popup is not movable and
+ * is just being closed. The bug has been reported to Apple. If they ever
+ * fix it, this block should be removed.
+ */
+
+ if ([theEvent type] == NSEventTypeAppKitDefined) {
+ static Bool aWindowIsMoving = NO;
+ switch([theEvent subtype]) {
+ case 20:
+ aWindowIsMoving = YES;
+ break;
+ case 21:
+ if (aWindowIsMoving) {
+ aWindowIsMoving = NO;
+ break;
+ } else {
+ // printf("Bug!!!!\n");
+ return;
+ }
+ default:
+ break;
+ }
+ }
[super sendEvent:theEvent];
[NSApp tkCheckPasteboard];
+
#ifdef TK_MAC_DEBUG_EVENTS
fprintf(stderr, "Sending event of type %d\n", (int)[theEvent type]);
DebugPrintQueue();
#endif
+
}
@end