The "/clear" command scrolls back to the top

Bug #1435007 reported by poy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
DC++
Fix Released
Low
Unassigned

Bug Description

in the DC++ chat, executing the "/clear" command while telling it to keep more lines shown than can be displayed in a single page of the chat control (eg "/clear 100") scrolls back to the top. it should scroll to the end if the chat was already scrolled to the end before running the command.

Test scenario:
1. Resize the window so only 10 lines are visible.
2. Write 50 lines in the main chat.
3. Make sure the scroll is at the bottom.
4. Write "/clear 30" (ie between 10 and 50).
5. Write new lines in the main chat.
Expected result: The scroll is at the bottom.
Actual result: The scroll is at the top.

Tags: chat clear scroll
Revision history for this message
Fredrik Ullner (ullner) wrote :

This patch should fix this.

Changed in dcplusplus:
status: Confirmed → In Progress
Revision history for this message
poy (poy) wrote :

hey,

are you sure? the problem i reported was with more lines to be kept than can be displayed in the chat; so a "linesToKeep > lineCount" test.

in the "linesToKeep < lineCount" case (where the patch is applied), there should be no need to scroll.

but if this patch does fix my issue, maybe it is the "lineCount" that is wrong...

Revision history for this message
Fredrik Ullner (ullner) wrote :

Perhaps I misunderstand what you want? Here's what I did;

1. Resize the window so only 10 lines are visible.
2. Write 20 (or something similar) lines in the main chat. <-- I did this by re-connecting to a test hub with a MOTD that is 20 lines, so this includes the "disconnected" etc messages.
3. Make sure the scroll is at the bottom.
4. Write /clear 5
5. Write 20 lines in the main (same as above).
Result: Scroll is at the bottom.

1. Resize the window so only 10 lines are visible.
2. Write 20 lines in the main chat.
3. Make sure the scroll is at the top.
4. Write /clear 5
5. Write 20 lines in the main.
Result: Scroll is at the top.

1. Resize the window so only 10 lines are visible.
2. Write 20 lines in the main chat.
3. Make sure the scroll is at the middle.
4. Write /clear 5
5. Write 20 lines in the main.
Result: Scroll is at the relative middle position.

Revision history for this message
poy (poy) wrote :

sorry i wasn't clear enough - i've updated the first post with a proper scenario.
tested on Win 8.1.

description: updated
Revision history for this message
Fredrik Ullner (ullner) wrote :

Without patch: I can confirm your actual result.
With patch: I can confirm your expected result (this is the first repro-steps in comment # 3).

Fredrik Ullner (ullner)
Changed in dcplusplus:
status: In Progress → Fix Committed
Revision history for this message
poy (poy) wrote :

diregard comment #2; I was confusing the total line count with the amount of lines per page...

I have fiddled with the code though to add a "scroll holder" tool. ;)

Revision history for this message
poy (poy) wrote :

Fixed in DC++ 0.860.

Changed in dcplusplus:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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