Bug 321967 - First time opening of third-level domain shrinks the last part
Summary: First time opening of third-level domain shrinks the last part
Status: RESOLVED FIXED
Alias: None
Product: rekonq
Classification: Applications
Component: web app (show other bugs)
Version: 2.3.0
Platform: Gentoo Packages Linux
: NOR minor
Target Milestone: ---
Assignee: Andrea Diamantini
URL: http://linux.org.ru
Keywords: usability
Depends on:
Blocks:
 
Reported: 2013-07-04 20:18 UTC by Mike Krutov
Modified: 2014-01-23 15:01 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Problem displayed (91.88 KB, image/png)
2013-07-04 20:19 UTC, Mike Krutov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Krutov 2013-07-04 20:18:20 UTC
Rekonq shrinks part of url if you are opening url for the first time.



Reproducible: Always

Steps to Reproduce:
1) Launch rekonq
2) (try) to open any site with three or more url parts for the first time (e.g. without previous items with same domain in history). For example:
linux.org.ru
arts.psto.net
mail.<companyname>.org
3) Behold
Actual Results:  
picrelated

Expected Results:  
Site with that domain opened

Workaround:
When you are at "Oops! can not load <page>" page, just add last domain part & press enter. Every next time you'll open your site the problem won't reproduce any time.

Reproducible NOT only on gentoo, previously I've seen the same behaviour on Ubuntu & FreeBSD (however I did not use KDE regulary back then so I'm not sure of 100% reproducibility that times).
Comment 1 Mike Krutov 2013-07-04 20:19:14 UTC
Created attachment 80950 [details]
Problem displayed
Comment 2 Mike Krutov 2013-07-04 20:20:54 UTC
Also,
You need exactly to open new tab & TYPE the url, e.g. for example for copy-paste this does not work, as for opening url from external application and so on.
Comment 3 Mike Krutov 2014-01-22 12:02:38 UTC
Also, I've identified the more exact steps to reproduce.
It seems that when you type an URL, rekonq will switch focus for your keyboard to dropdown menu, which can has at that moment (given user types fast enough) "http://some-url.co", e.g. not finished URL, or the latest matching element in history (e.g. from time to time when I open google, I end up with my last google search instead of actual google page).
This is slightly more likely to happen when the machine on which Rekonq is running is under some load.

The workaround for this is just to wait around a second after finishing the typing.

If someone could consult me how this is organized, I would be happy to try to fix this behavior. 

Update:
Not sure how to explain this, so not updating the reproduce steps.
I've added pseudo-debugging via kError() calls on keyPressedEvent in urlbar and that resulted in following:

I've typed "linux.org.ru <enter>".

Last 'log' event from void UrlBar::keyPressEvent(QKeyEvent *event) was dumped as follows:

rekonq(30152): Key pressed 
rekonq(30152): Trimmed is  "http://linux.org.r" 
rekonq(30152): Text is  "http://linux.org.r" 

Then, linux.org.r was opened (or not opened tbh).

I've used following addition to the code (urlbar.cpp):
void UrlBar::keyPressEvent(QKeyEvent *event)
{
    QString trimmedText = text().trimmed();
    kError()<< "Key pressed";
    kError()<<"Trimmed is " << trimmedText;
    kError()<<"Text is "<< text();

.....
}
Please help me with understanding what actually happens in here.
Comment 4 Mike Krutov 2014-01-22 12:49:06 UTC
Okay I've read some docs and found out following:
1) keyPressEvent is emited before text() gets updated
2) keyReleaseEvent is emited after text() gets updated
Thus, review-request https://git.reviewboard.kde.org/r/115223/ was created.
Patch includes only substitute of keyPressEvent() to keyReleaseEvent().

:)
Comment 5 Andrea Diamantini 2014-01-23 15:01:40 UTC
Git commit 5f13021dbc94c13336deb1d2a4849908c9db231e by Andrea Diamantini, on behalf of Mikhail Krutov.
Committed on 23/01/2014 at 14:47.
Pushed by adjam into branch 'master'.

Get sure fast typing work!
Related: bug 316552
REVIEW: 115223
REVIEWED-BY: adjam
(PS: Many thanks for this, Mikhail...)

M  +3    -3    src/urlbar/urlbar.cpp
M  +1    -1    src/urlbar/urlbar.h

http://commits.kde.org/rekonq/5f13021dbc94c13336deb1d2a4849908c9db231e