~ubuntu-branches/ubuntu/gutsy/vnc4/gutsy

« back to all changes in this revision

Viewing changes to unix/xc/programs/Xserver/hw/darwin/quartz/XView.m

  • Committer: Bazaar Package Importer
  • Author(s): Ola Lundqvist
  • Date: 2006-05-15 20:35:17 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060515203517-l4lre1ku942mn26k
Tags: 4.1.1+X4.3.0-10
* Correction of critical security issue. Thanks to Martin Kogler
  <e9925248@student.tuwien.ac.at> that informed me about the issue,
  and provided the patch.
  This flaw was originally found by Steve Wiseman of intelliadmin.com.
* Applied patch from Javier Kohen <jkohen@users.sourceforge.net> that
  inform the user that only 8 first characters of the password will
  actually be used when typing more than 8 characters, closes:
  #355619.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * NSView subclass for Mac OS X rootless X server
 
3
 *
 
4
 * Each rootless window contains an instance of this class.
 
5
 * This class handles events while drawing is handled by Carbon
 
6
 * code in the rootless Aqua implementation.
 
7
 *
 
8
 * Copyright (c) 2001 Greg Parker. All Rights Reserved.
 
9
 *
 
10
 * Permission is hereby granted, free of charge, to any person obtaining a
 
11
 * copy of this software and associated documentation files (the "Software"),
 
12
 * to deal in the Software without restriction, including without limitation
 
13
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 
14
 * and/or sell copies of the Software, and to permit persons to whom the
 
15
 * Software is furnished to do so, subject to the following conditions:
 
16
 *
 
17
 * The above copyright notice and this permission notice shall be included in
 
18
 * all copies or substantial portions of the Software.
 
19
 *
 
20
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 
21
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 
22
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
 
23
 * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
 
24
 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 
25
 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 
26
 * DEALINGS IN THE SOFTWARE.
 
27
 *
 
28
 * Except as contained in this notice, the name(s) of the above copyright
 
29
 * holders shall not be used in advertising or otherwise to promote the sale,
 
30
 * use or other dealings in this Software without prior written authorization.
 
31
 */
 
32
/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/XView.m,v 1.2 2002/07/15 19:58:31 torrey Exp $ */
 
33
 
 
34
#import "XView.h"
 
35
 
 
36
 
 
37
@implementation XView
 
38
 
 
39
- (BOOL)isFlipped
 
40
{
 
41
    return NO;
 
42
}
 
43
 
 
44
- (BOOL)isOpaque
 
45
{
 
46
    return YES;
 
47
}
 
48
 
 
49
- (BOOL)acceptsFirstResponder
 
50
{
 
51
    return YES;
 
52
}
 
53
 
 
54
- (BOOL)acceptsFirstMouse:(NSEvent *)theEvent
 
55
{
 
56
    return YES;
 
57
}
 
58
 
 
59
- (BOOL)shouldDelayWindowOrderingForEvent:(NSEvent *)theEvent
 
60
{
 
61
    return YES;
 
62
}
 
63
 
 
64
- (void)mouseDown:(NSEvent *)anEvent
 
65
{
 
66
    // Only X is allowed to restack windows.
 
67
    [NSApp preventWindowOrdering];
 
68
    if (! [NSApp isActive]) {
 
69
        [NSApp activateIgnoringOtherApps:YES];
 
70
        // FIXME: Interleaving with other apps would be nice, but has issues.
 
71
        [NSApp arrangeInFront:nil];
 
72
    }
 
73
    [[self nextResponder] mouseDown:anEvent];
 
74
}
 
75
 
 
76
@end