Closed
Bug 124638
Opened 23 years ago
Closed 22 years ago
Chatzilla steals focus (when joining channels)
Categories
(Other Applications :: ChatZilla, defect)
Other Applications
ChatZilla
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: neil, Assigned: rginda)
References
Details
Attachments
(1 file, 1 obsolete file)
(deleted),
patch
|
Details | Diff | Splinter Review |
I thought this would be fixed when mail and news was fixed, but apparently not.
When I click the chatzilla button I can move the window to the back. As soon as
it connects to the server it pops to the front. It should stay at the back
where I told it to go.
Comment 1•23 years ago
|
||
It also pops to the front when there is activity in a channel or other window -
very annoying.
Comment 2•23 years ago
|
||
I don't see this on Linux. I'll try to test it on Windows.
You can make it stop taking focus when people message you, by typing:
"/eval client.FLASH_WINDOW=false".
This setting is persistant.
Comment 3•23 years ago
|
||
Had this on linux.
Well, hope your tip works:
[EVAL-IN]client.FLASH_WINDOW=false
[EVAL-OUT]false
Comment 4•23 years ago
|
||
This also occurs twice after clicking a chatzilla IRC URL that includes a
channel. It will give focus when it connects to the server and when it joins the
channel.
Comment 5•23 years ago
|
||
*** Bug 136355 has been marked as a duplicate of this bug. ***
Comment 6•23 years ago
|
||
Just for the sake of completeness: If you choose to auto-open some channels at
chatzilla startup, the chatzilla window pops in front for joining each and every
of these channels and their servers, which makes mozilla practically unusable
for some time until all connections are made.
Updated•22 years ago
|
OS: Windows 2000 → All
Hardware: PC → All
Comment 7•22 years ago
|
||
*** Bug 160827 has been marked as a duplicate of this bug. ***
Updated•22 years ago
|
Summary: Chatzilla steals focus → Chatzilla steals focus (when joining channels)
Comment 8•22 years ago
|
||
Commenting out line 50 in handlers.js in chatzilla.jar
(http://lxr.mozilla.org/seamonkey/source/extensions/irc/xul/content/handlers.js#50)
prevents this bug from happening.
Since that line calls "input.focus()" and the input element is a textbox I think
this is caused by bug 124750.
However, I don't know yet about the side-effects of removing this line. One of
them is that after editing the channel topic the input line is not automatically
focused again (which is surely less annoying).
I'll try to find a solution without side effects.
Comment 9•22 years ago
|
||
*** Bug 135014 has been marked as a duplicate of this bug. ***
Comment 10•22 years ago
|
||
One quick-and-dirty option is to do
if (document.commandDispatcher.focusedElement != client.input.mInputField)
client.input.focus();
Another possibility is
if (Components.classes["@mozilla.org/embedcomp/window-watcher;1"]
.getService(Components.interfaces.nsIWindowWatcher)
.activeWindow == window)
client.input.focus();
else
document.commandDispatcher.focusedElement = client.input;
}
Comment 11•22 years ago
|
||
This patch implements the second proposal from comment #10.
-> Patch bei Neil.
He told me on IRC that this is good enough as a 'final' patch.
It uses the approach from navigator.js, around line 630, to prevent the problem
from appearing (see bug 97067): it only sets focus to the input field if the
window is already the active one. If it isn't, the focus is only remembered and
then restored, when the window becomes active.
Requesting review from rginda.
Updated•22 years ago
|
Attachment #113890 -
Flags: review?(rginda)
Assignee | ||
Comment 12•22 years ago
|
||
Comment on attachment 113890 [details] [diff] [review]
Patch (by Neil)
I don't like to break lines in the middle of an object reference. I'll post a
patch with more acceptable line breaking.
Attachment #113890 -
Flags: review?(rginda) → review-
Assignee | ||
Comment 13•22 years ago
|
||
Attachment #113890 -
Attachment is obsolete: true
Assignee | ||
Comment 14•22 years ago
|
||
I'll post a new xpi with this fix to hacksrus.
Status: NEW → ASSIGNED
Comment 15•22 years ago
|
||
Great! Well... that patch seems to content some more stuff... but I'm sure only
good stuff. :-)
Assignee | ||
Comment 16•22 years ago
|
||
Oops, I forgot that suff was still in there. Thats from bug 191910.
Comment 17•22 years ago
|
||
Comment on attachment 114242 [details] [diff] [review]
same patch, different line breaks
> function focusInput ()
> {
>- client.input.focus();
>+ const WWATCHER_CTRID = "@mozilla.org/embedcomp/window-watcher;1";
>+ const nsIWindowWatcher = Components.interfaces.nsIWindowWatcher;
>+
>+ var watcher =
>+ Components.classes[WWATCHER_CTRID]..getService(nsIWindowWatcher);
>+ if (watcher.activeWindow == window)
>+ client.input.focus();
>+ else
>+ document.commandDispatcher.focusedElement = client.input;
On my Linux, the input field of cz0.8.22 doesn't get focus.
I have to click the field before writing a message.
Win98 doesn't have any problem.
Comment 18•22 years ago
|
||
You can press the Esc key to focus the input line.
Assignee | ||
Comment 19•22 years ago
|
||
I've noticed this problem too. ESC doesn't even focus the field for me at
first. I have to click to give the input field focus the first time, but after
that it works as expected. I suspect this is a bug in the focus code itself.
It would be nice if we could find a workaround though.
Assignee | ||
Comment 20•22 years ago
|
||
checked in
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Updated•20 years ago
|
Product: Core → Other Applications
You need to log in
before you can comment on or make changes to this bug.
Description
•