~ubuntu-branches/ubuntu/gutsy/tk8.4/gutsy-updates

« back to all changes in this revision

Viewing changes to macosx/tkMacOSXWindowEvent.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2007-01-05 15:56:45 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070105155645-8srmlwqo7m1q86qi
Tags: 8.4.14-0ubuntu1
New upstream version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
54
54
 *      software in accordance with the terms specified in this
55
55
 *      license.
56
56
 *
57
 
 * RCS: @(#) $Id: tkMacOSXWindowEvent.c,v 1.3.2.6 2005/11/30 01:02:55 hobbs Exp $
 
57
 * RCS: @(#) $Id: tkMacOSXWindowEvent.c,v 1.3.2.15 2006/09/10 17:07:36 das Exp $
58
58
 */
59
59
 
60
60
#include "tkMacOSXInt.h"
61
 
#include "tkPort.h"
62
61
#include "tkMacOSXWm.h"
63
62
#include "tkMacOSXEvent.h"
64
63
#include "tkMacOSXDebug.h"
100
99
 *----------------------------------------------------------------------
101
100
 */
102
101
 
103
 
int
 
102
MODULE_SCOPE int
104
103
TkMacOSXProcessApplicationEvent(
105
104
        TkMacOSXEvent *eventPtr, 
106
105
        MacEventStatus *statusPtr)
129
128
            statusPtr->stopProcessing = 1;
130
129
            break;
131
130
        case kEventAppHidden:
132
 
            /*
133
 
             * Don't bother if we don't have an interp or
134
 
             * the show preferences procedure doesn't exist.
135
 
             */
136
 
            toggleHide = 1;
137
 
            if ((eventPtr->interp == NULL) || 
138
 
                    (Tcl_GetCommandInfo(eventPtr->interp, 
139
 
                    "::tk::mac::OnHide", &dummy)) == 0) {
140
 
               break;
 
131
            if (toggleHide == 0) {
 
132
                toggleHide = 1;
 
133
                if (eventPtr->interp && Tcl_GetCommandInfo(eventPtr->interp, 
 
134
                        "::tk::mac::OnHide", &dummy)) {
 
135
                    Tcl_GlobalEval(eventPtr->interp, "::tk::mac::OnHide");
 
136
                }
141
137
            }
142
 
            Tcl_GlobalEval(eventPtr->interp, "::tk::mac::OnHide");
143
138
            statusPtr->stopProcessing = 1;
144
139
            break;
145
140
        case kEventAppShown:
146
141
            if (toggleHide == 1) {
147
142
                toggleHide = 0;
148
 
                if ((eventPtr->interp == NULL) || 
149
 
                        (Tcl_GetCommandInfo(eventPtr->interp, 
150
 
                        "::tk::mac::OnShow", &dummy)) == 0) {
151
 
                    break;
 
143
                if (eventPtr->interp && Tcl_GetCommandInfo(eventPtr->interp, 
 
144
                        "::tk::mac::OnShow", &dummy)) {
 
145
                    Tcl_GlobalEval(eventPtr->interp, "::tk::mac::OnShow");
152
146
                }
153
 
                Tcl_GlobalEval(eventPtr->interp, "::tk::mac::OnShow");
154
147
            }
155
148
            statusPtr->stopProcessing = 1;
156
149
            break;
185
178
 *----------------------------------------------------------------------
186
179
 */
187
180
 
188
 
int
 
181
MODULE_SCOPE int
189
182
TkMacOSXProcessWindowEvent(
190
183
        TkMacOSXEvent * eventPtr, 
191
184
        MacEventStatus * statusPtr)
239
232
            dispPtr = TkGetDisplayList();
240
233
            winPtr = (TkWindow *)Tk_IdToWindow(dispPtr->display, window);
241
234
            if (winPtr) {
242
 
                TkpWmSetState(winPtr, NormalState);
 
235
                TkpWmSetState(winPtr, TkMacOSXIsWindowZoomed(winPtr) ?
 
236
                        ZoomState : NormalState);
243
237
            }
244
238
            break;
245
239
        }
247
241
    return 0;
248
242
}
249
243
 
250
 
/*         
 
244
/*
251
245
 *----------------------------------------------------------------------
252
 
 *                      
 
246
 *
253
247
 * GenerateUpdateEvent --
254
 
 *                      
 
248
 *
255
249
 *      Given a Macintosh window update event this function generates all the
256
250
 *      X update events needed by Tk.
257
251
 *
456
450
 *----------------------------------------------------------------------
457
451
 */     
458
452
 
459
 
int
 
453
MODULE_SCOPE int
460
454
TkMacOSXGenerateFocusEvent(
461
455
    Window window,              /* Root X window for event. */
462
456
    int    activeFlag )
472
466
    }
473
467
 
474
468
    /*
 
469
     * Don't send focus events to windows of class help or to
 
470
     * windows with the kWindowNoActivatesAttribute.
 
471
     */
 
472
    if (((TkWindow *)tkwin)->wmInfoPtr->macClass == kHelpWindowClass ||
 
473
            ((TkWindow *)tkwin)->wmInfoPtr->attributes &
 
474
                    kWindowNoActivatesAttribute) {
 
475
        return false;
 
476
    }
 
477
 
 
478
    /*
475
479
     * Generate FocusIn and FocusOut events.  This event
476
480
     * is only sent to the toplevel window.
477
481
     */
617
621
     * ConfigureNotify to set these values.  On the Mac we know imediatly that
618
622
     * this is what we want - so we just set them.  However, we need to
619
623
     * make sure the windows clipping region is marked invalid so the
620
 
     * change is visable to the subwindow.
 
624
     * change is visible to the subwindow.
621
625
     */
622
626
    winPtr->changes.x = x;
623
627
    winPtr->changes.y = y;
624
628
    winPtr->changes.width = width;
625
629
    winPtr->changes.height = height;
626
 
    TkMacOSXInvalClipRgns(winPtr);
 
630
    TkMacOSXInvalClipRgns(tkwin);
627
631
}
628
632
 
629
633
/*