chat-write-area looses focus when the scrollbar appears (Windows XP) and now breaks the Notes and other stuff.

Bug #297970 reported by mirkobau
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Coccinella
Fix Released
High
sander

Bug Description

when writing a new message in the chat area, everything is ok ...until i type too much and the vertical scroll bar appears; after this, the focus in the chat-writing-area is lost, and everything i type is obviously lost too.

chat-writing-area looses focus also when a scrollbar appears outside that window (but still in one of the coccinella windows).
In example:
when writing messages in a new-and-clean chat window, and the visible-history grows up...when it needs a scroll bar and the bar appear.. focus is lost.

Revision history for this message
Puddy (puddyput-gmx) wrote :

I can confirm that. Its REALLY annoying :)

Revision history for this message
mirkobau (j-launchpad-mirkobau-it) wrote :

please consider this bug.
it's ***REALLY*** annoying.

a workaround to this - hey, but this can't be a real solution - could be:
step1) elarge chat-writing-area while typing (like skype 4 does)
step2) re-request focus every time the user releases a key on the keyboard (GULP!)

Revision history for this message
sander (s-devrieze) wrote : Re: [Bug 297970] Re: chat-write-area looses focus when the scrollbar appears (Windows XP)

Can you test if the same problem is existent when using the source
distribution of Coccinella and the latest Tcl/Tk version? Maybe this
is a bug in Tk that has been fixed.

Sorry that this takes so long, but since the sad news about Mats I am
virtually alone working on Coccinella, which still is an issue since I
am no real programmer (very recently Amazon delivered me 2 books to
learn Tcl/Tk programming, but I need time to read them first...so
don't expect groundbreaking new features/bugfixes in the next
release(s)...though; patches are very welcome! ;-) )

Revision history for this message
mirkobau (j-launchpad-mirkobau-it) wrote : Re: chat-write-area looses focus when the scrollbar appears (Windows XP)

SOLVED!
Here's the correction; it only involves the function UI::ScrollSet from libs/UI.tcl:

# UI::ScrollSet --
#
# Command for auto hide/show scrollbars.

# 12th June 2009
# corrected a bug (badly but..hey, it works!) by Mirko Graziani (<email address hidden>)
# The problem is: scrollbars take the focus when they appear.
# My solution is:
# i'll remember which object had focus before the scrollbar became visible,
# and re-set the focus on the correct object everytime this funcion is called.
# Maybe setting focus *every* time is redundant, and could be not very elegant,
# but i know too little Coccinella source code to filter the cases.
#
# for some other info, see Coccinella bug: https://bugs.launchpad.net/bugs/297970

proc ::UI::ScrollSet {wscrollbar geocmd offset size} {
   # get the geometry manager
   set manager [lindex $geocmd 0]
   # Create the name for the focus
   set wfocus $wscrollbar.focus
   # that name must survive
   global $wfocus
   if {($offset != 0.0) || ($size != 1.0)} {
      # If the scrollbar hasn't a geomanager,
      # it means that this time it will appear (and get a geomanager)
      # then i record the name of the current focused object
      if {[string equal [$manager info $wscrollbar] ""]} {
         set $wfocus [focus]
      }
      eval $geocmd
      $wscrollbar set $offset $size
   } else {
      $manager forget $wscrollbar
   }

   # Whatever would happen, i always will set the focus
   # on the "current focused object" recorded in the lines above.
   if {[info exists $wfocus]} {
      focus [set $wfocus]
   }
}

sander (s-devrieze)
Changed in coccinella:
assignee: nobody → sander (s-devrieze)
importance: Undecided → High
status: New → Fix Committed
Revision history for this message
sander (s-devrieze) wrote :

@mirkobau: it seems your patch created a bug in the preferences dialog:

window ".prefs.frall.f.f.t.frtree.sby" isn't packed
window ".prefs.frall.f.f.t.frtree.sby" isn't packed
    while executing
"$manager info $wscrollbar"
    (procedure "::UI::ScrollSet" line 12)
    invoked from within
"::UI::ScrollSet .prefs.frall.f.f.t.frtree.sby {pack .prefs.frall.f.f.t.frtree.sby -side right -fill y} 0 0.948787"

(see lib/Preferences.tc line 206)

This bug can be reproduced by setting the Skin in Appearance to "Default". The scroll bar will disappear when you do that.

Can you fix the new bug?

Revision history for this message
buzzdee (sebastia) wrote :

Probably the same problem when typing too much lines in to the Notes of a Business Card.

window ".juserinfosebastiablahblahde.frall.nb.not.f.s" isn't packed
window ".juserinfosebastiablahblahde.frall.nb.not.f.s" isn't packed
    while executing
"$manager info $wscrollbar"
    (procedure "::UI::ScrollSet" line 12)
    invoked from within
"::UI::ScrollSet .juserinfosebastiablahblahde.frall.nb.not.f.s {pack .juserinfosebastiablahblahde.frall.nb.not.f.s -side right -fill ..."
    (vertical scrolling command executed by text)

buzzdee (sebastia)
summary: - chat-write-area looses focus when the scrollbar appears (Windows XP)
+ chat-write-area looses focus when the scrollbar appears (Windows XP) and
+ now breaks the Notes and other stuff.
Changed in coccinella:
status: Fix Committed → Confirmed
milestone: none → 0.96.16
Revision history for this message
sander (s-devrieze) wrote :

The bug also appears on Mac OS X in the annotations tabblad *when* the text still fits! See attached image.

buzzdee (sebastia)
Changed in coccinella:
milestone: 0.96.16 → 0.96.18
Revision history for this message
buzzdee (sebastia) wrote :

the problem in the notes window and the preferences is fixed for me in svn revision #2773.
Now UI::Scrollset first checks that the manager is not "pack", as it is in the preferences or the business card window.

So far works for me, the preferences and the notes window do not throw an exception anymore, and also when entering notes, the input window keeps focus when the scrollbar appears/disappears.

Changed in coccinella:
status: Confirmed → Fix Committed
buzzdee (sebastia)
Changed in coccinella:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.