mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 03:21:04 +00:00
tweaks
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29044 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
9abe733e93
commit
47f9930e07
4 changed files with 30 additions and 38 deletions
|
@ -597,8 +597,7 @@ typedef struct {
|
|||
int pos;
|
||||
int end;
|
||||
|
||||
NSAssert(elementState <= GSThemeSelectedState, NSInvalidArgumentException);
|
||||
if (elementState < 0)
|
||||
if (elementState < 0 || elementState > GSThemeSelectedState)
|
||||
{
|
||||
pos = 0;
|
||||
end = GSThemeSelectedState;
|
||||
|
@ -1177,8 +1176,7 @@ typedef struct {
|
|||
int pos;
|
||||
int end;
|
||||
|
||||
NSAssert(elementState <= GSThemeSelectedState, NSInvalidArgumentException);
|
||||
if (elementState < 0)
|
||||
if (elementState < 0 || elementState > GSThemeSelectedState)
|
||||
{
|
||||
pos = 0;
|
||||
end = GSThemeSelectedState;
|
||||
|
|
|
@ -732,26 +732,9 @@ withRepeatedImage: (NSImage*)image
|
|||
GSDrawTiles *c = (GSDrawTiles*)NSCopyObject(self, 0, zone);
|
||||
unsigned i;
|
||||
|
||||
c->images[0] = [images[0] copy];
|
||||
for (i = 1; i < 9; i++)
|
||||
for (i = 0; i < 9; i++)
|
||||
{
|
||||
unsigned j;
|
||||
|
||||
for (j = 0; j < i; j++)
|
||||
{
|
||||
if (images[i] == images[j])
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (j < i)
|
||||
{
|
||||
c->images[i] = RETAIN(c->images[j]);
|
||||
}
|
||||
else
|
||||
{
|
||||
c->images[i] = [images[i] copy];
|
||||
}
|
||||
c->images[i] = [images[i] copyWithZone: zone];
|
||||
}
|
||||
c->style = style;
|
||||
return c;
|
||||
|
@ -883,15 +866,10 @@ withRepeatedImage: (NSImage*)image
|
|||
}
|
||||
else
|
||||
{
|
||||
#if !defined(__MINGW32__)
|
||||
/* This code raises an exception on windows (tested 30/10/2009) ... why? */
|
||||
images[i]
|
||||
= [[self extractImageFrom: image withRect: rects[i]] retain];
|
||||
rects[i].origin.x = 0;
|
||||
rects[i].origin.y = 0;
|
||||
#else
|
||||
images[i] = [image retain];
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1821,6 +1821,7 @@ See Also: -runModalForWindow:
|
|||
}
|
||||
else
|
||||
{
|
||||
NSLog(@"Discard %@", event);
|
||||
event = nil; // Ignore/discard this event.
|
||||
}
|
||||
}
|
||||
|
@ -1845,8 +1846,9 @@ See Also: -runModalForWindow:
|
|||
/*
|
||||
* Check to see if the window has gone away - if so, end session.
|
||||
*/
|
||||
if ([[self windows] indexOfObjectIdenticalTo: _session->window] == NSNotFound
|
||||
|| ![_session->window isVisible])
|
||||
if ([[self windows] indexOfObjectIdenticalTo: _session->window]
|
||||
== NSNotFound
|
||||
|| ![_session->window isVisible])
|
||||
{
|
||||
[self stopModal];
|
||||
}
|
||||
|
@ -2045,11 +2047,11 @@ See -runModalForWindow:
|
|||
if (!theEvent)
|
||||
NSDebugLLog(@"NSEvent", @"NSEvent is nil!\n");
|
||||
if (type == NSMouseMoved)
|
||||
NSDebugLLog(@"NSMotionEvent", @"Send move (%d) to window %d",
|
||||
type, [window windowNumber]);
|
||||
NSDebugLLog(@"NSMotionEvent", @"Send move (%d) to %@",
|
||||
type, window);
|
||||
else
|
||||
NSDebugLLog(@"NSEvent", @"Send NSEvent type: %d to window %d",
|
||||
type, [window windowNumber]);
|
||||
NSDebugLLog(@"NSEvent", @"Send NSEvent type: %d to %@",
|
||||
type, window);
|
||||
if (window)
|
||||
[window sendEvent: theEvent];
|
||||
else if (type == NSRightMouseDown)
|
||||
|
@ -3877,7 +3879,7 @@ struct _DelegateWrapper
|
|||
{
|
||||
_key_window = obj;
|
||||
}
|
||||
else
|
||||
else if (_key_window != obj)
|
||||
{
|
||||
NSLog(@"Bogus attempt to set key window");
|
||||
}
|
||||
|
@ -3891,7 +3893,7 @@ struct _DelegateWrapper
|
|||
{
|
||||
_main_window = obj;
|
||||
}
|
||||
else
|
||||
else if (_main_window != obj)
|
||||
{
|
||||
NSLog(@"Bogus attempt to set main window");
|
||||
}
|
||||
|
|
|
@ -800,6 +800,12 @@ many times.
|
|||
[super dealloc];
|
||||
}
|
||||
|
||||
- (NSString*) description
|
||||
{
|
||||
return [[super description] stringByAppendingFormat: @"Number: %d Title: %@",
|
||||
[self windowNumber], [self title]];
|
||||
}
|
||||
|
||||
- (void) _startBackendWindow
|
||||
{
|
||||
NSDictionary *info;
|
||||
|
@ -3539,7 +3545,10 @@ resetCursorRectsForView(NSView *theView)
|
|||
We let NSAppKitDefined events through since they deal with window ordering.
|
||||
*/
|
||||
if (!_f.visible && [theEvent type] != NSAppKitDefined)
|
||||
return;
|
||||
{
|
||||
NSDebugLLog(@"NSEvent", @"Discard (window not visible) %@", theEvent);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!_f.cursor_rects_valid)
|
||||
{
|
||||
|
@ -3548,8 +3557,9 @@ resetCursorRectsForView(NSView *theView)
|
|||
|
||||
type = [theEvent type];
|
||||
if ([self ignoresMouseEvents]
|
||||
&& GSMouseEventMask == NSEventMaskFromType(type))
|
||||
&& GSMouseEventMask == NSEventMaskFromType(type))
|
||||
{
|
||||
NSDebugLLog(@"NSEvent", @"Discard (window ignoring mouse) %@", theEvent);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -3626,6 +3636,10 @@ resetCursorRectsForView(NSView *theView)
|
|||
[self mouseDown: theEvent];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
NSDebugLLog(@"NSEvent", @"Discard (window closed) %@", theEvent);
|
||||
}
|
||||
_lastPoint = [theEvent locationInWindow];
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue