summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-13 15:47:39 +0000
committerpinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-13 15:47:39 +0000
commit5604aa5da991f9adea3251ddb48627d5c0bf2061 (patch)
tree5a813e21d458d58c8fce0a1de329a7b192b7c343
parentc074a54a4f5256cc33c6556c68b0c2a3b989e250 (diff)
downloadchromium_src-5604aa5da991f9adea3251ddb48627d5c0bf2061.zip
chromium_src-5604aa5da991f9adea3251ddb48627d5c0bf2061.tar.gz
chromium_src-5604aa5da991f9adea3251ddb48627d5c0bf2061.tar.bz2
Fix issue where dragging a newly created tab drags the entire window by commenting out some use of CoreAnimation. BUG=11829. TEST=dragging tags out of a new window.
Review URL: http://codereview.chromium.org/113343 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15959 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/cocoa/tab_strip_controller.mm14
1 files changed, 13 insertions, 1 deletions
diff --git a/chrome/browser/cocoa/tab_strip_controller.mm b/chrome/browser/cocoa/tab_strip_controller.mm
index 237e520..88f1dac 100644
--- a/chrome/browser/cocoa/tab_strip_controller.mm
+++ b/chrome/browser/cocoa/tab_strip_controller.mm
@@ -210,10 +210,16 @@
tabFrame.origin.x = offset;
}
+#if 0
// Animate the tab in by putting it below the horizon.
+ // TODO(pinkerton/alcor): While this looks nice, it confuses the heck
+ // out of the window server and causes the window to think that there's
+ // no tab there. The net result is that dragging the tab also drags
+ // the window. We need to find another way to do this.
if (newTab && visible) {
[[tab view] setFrame:NSOffsetRect(tabFrame, 0, -NSHeight(tabFrame))];
}
+#endif
id frameTarget = visible ? [[tab view] animator] : [tab view];
tabFrame.size.width = [tab selected] ? kMaxTabWidth : baseTabWidth;
@@ -270,8 +276,14 @@
TabController* newController = [self newTab];
[tabArray_ insertObject:newController atIndex:index];
NSView* newView = [newController view];
+
+ // Set the originating frame to just below the strip so that it animates
+ // upwards as it's being initially layed out. Oddly, this works while doing
+ // something similar in |-layoutTabs| confuses the window server.
+ // TODO(pinkerton): I'm not happy with this animiation either, but it's
+ // a little better that just sliding over (maybe?).
[newView setFrame:NSOffsetRect([newView frame],
- 0, [[self class] defaultTabHeight])];
+ 0, -[[self class] defaultTabHeight])];
[tabView_ addSubview:newView
positioned:inForeground ? NSWindowAbove : NSWindowBelow