Closed
Bug 393250
Opened 17 years ago
Closed 17 years ago
titlebar=no windows do not receive keyboard events
Categories
(Core :: Widget: Cocoa, defect)
Tracking
()
VERIFIED
FIXED
mozilla1.9beta1
People
(Reporter: bent.mozilla, Assigned: smichaud)
References
(Blocks 1 open bug)
Details
(Keywords: regression)
Attachments
(2 files, 1 obsolete file)
597 bytes,
application/vnd.mozilla.xul+xml
|
Details | |
4.70 KB,
patch
|
jaas
:
review+
roc
:
superreview+
|
Details | Diff | Splinter Review |
Windows without titlebars are broken in Cocoa widgets. Mouse events seem to work just fine but keyboard events are not focused correctly. I have a small XULRunner app as a testcase hosted here:
http://dingo.songbirdnest.com/~ben/mozilla/titlebartest.zip
Unfortunately I can't put it in bugzilla as it is about 10mb...
Flags: blocking1.9?
Reporter | ||
Updated•17 years ago
|
Severity: normal → major
Reporter | ||
Comment 1•17 years ago
|
||
Ok, Håkan reminded me that I could do this easier... Thanks!
So to test save this file on your hard disk somewhere. Then type this into the error console:
window.open('file:////Users/ben/Desktop/test.xul', '', 'chrome,centerscreen,titlebar=no');
That should do it (as long as you substitute the file path appropriately).
Reporter | ||
Comment 2•17 years ago
|
||
Oh, and the testcase works fine on the 1.8 branch.
-> regression
Keywords: regression
Blocks: 372987
Assignee | ||
Updated•17 years ago
|
Assignee: joshmoz → smichaud
Assignee | ||
Comment 3•17 years ago
|
||
Here's a fix for this bug.
Turns out that Cocoa special-cases windows without titlebars -- by
default they can't become either the "key window" or the "main
window". (If a window can't become "key", it can't accept keyboard
input.)
I had to play some tricks to work around this.
Even after this fix, though, there's still some other wierdness. I
can't figure out whether or not it's by design:
After the fix, a window created using the procedure in comment #1 has
only a very truncated main menu -- it just includes the Apple and
"Minefield" top-level menu items. (It's not modal, though.)
And even before the fix, this is true of a window created using the
following command in the Error Console:
window.open('file:////Users/ben/Desktop/test.xul', '',
'chrome,centerscreen');
This looks intentional ... but is it?
Attachment #284984 -
Flags: review?(joshmoz)
Assignee | ||
Comment 4•17 years ago
|
||
Regardless of the verdict on the "truncated main menu" issue (whether
it's a bug or a feature), that's a separate matter, unrelated to this
bug. It shouldn't block the landing of this bug's patch.
If we decide the "truncated main menu" is a bug, I'll open a new bug
on it.
Comment on attachment 284984 [details] [diff] [review]
Fix
Not going to be this easy unfortunately. This causes key window handlers to kick in and whatnot, leading to different event routing and menu bars.
One thing this breaks is the Places toolbar item. Open that and try to select an item from "Most Visited Pages". It doesn't work and the submenu kicks up a new menu bar.
Attachment #284984 -
Flags: review?(joshmoz) → review-
Reporter | ||
Comment 6•17 years ago
|
||
Just to chime in, we use a titlebar=no window as our main application, so we would consider the truncated menu as a bug :)
Assignee | ||
Comment 7•17 years ago
|
||
> Just to chime in, we use a titlebar=no window as our main
> application, so we would consider the truncated menu as a bug :)
So it sounds like the truncated menu problem actually cripples your
"main application" (which I assume is Songbird).
(I'm trying to figure out how serious the truncated menu problem is.)
Reporter | ||
Comment 8•17 years ago
|
||
(In reply to comment #7)
> So it sounds like the truncated menu problem actually cripples your
> "main application" (which I assume is Songbird).
Correct.
Assignee | ||
Comment 9•17 years ago
|
||
I made a dumb mistake in my previous patch -- I forgot that popup
windows are also borderless (have no titlebar). So I inadvertently
changed every popup window from class PopupWindow to class
BorderlessWindow ... which would have messed up all popup windows :-(
Thanks, Josh, for noticing that there was something wrong :-)
Anyway, _this_ patch should do the trick.
(It doesn't (of course) fix the truncated menu problem. I'll open a
new bug on that.)
Attachment #284984 -
Attachment is obsolete: true
Attachment #285162 -
Flags: review?(joshmoz)
Assignee | ||
Comment 10•17 years ago
|
||
> (It doesn't (of course) fix the truncated menu problem. I'll open a
> new bug on that.)
I've opened bug 400084 and assigned it to myself.
Assignee | ||
Comment 11•17 years ago
|
||
I'm going to have to post another revision -- I noticed that a window
created using the following still doesn't become main (or get keyboard
events):
window.open('file:////Users/ben/Desktop/test.xul', '',
'titlebar=no');
Sigh :-(
Assignee | ||
Updated•17 years ago
|
Attachment #285162 -
Flags: review?(joshmoz)
Assignee | ||
Comment 12•17 years ago
|
||
Comment on attachment 285162 [details] [diff] [review]
Fix rev1 (fix dumb mistake)
> I'm going to have to post another revision -- I noticed that a
> window created using the following still doesn't become main (or get
> keyboard events):
>
> window.open('file:////Users/ben/Desktop/test.xul', '',
> 'titlebar=no');
Turns out it was my test that was wrong.
As far as I can tell, my rev1 patch (attachment 285162 [details] [diff] [review]) works and has
no side effects.
Attachment #285162 -
Flags: review?(joshmoz)
Attachment #285162 -
Flags: superreview?(roc)
Attachment #285162 -
Flags: review?(joshmoz)
Attachment #285162 -
Flags: review+
Attachment #285162 -
Flags: superreview?(roc) → superreview+
Assignee | ||
Comment 13•17 years ago
|
||
I will land this when the tree reopens.
Assignee | ||
Comment 14•17 years ago
|
||
Landed on trunk.
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Reporter | ||
Comment 15•17 years ago
|
||
Yay, thanks!
Comment 16•17 years ago
|
||
verified fixed using Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.9a9pre) Gecko/2007102404 Minefield/3.0a9pre. I used bent's wonderful test case to verify.
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•