Maybe this fixes issues we had with QtWebEngine segfaults in proxy.py on
Travis?
Note we can't move cookies/cache/network stuff yet as we still need that
for e.g. adblock downloads with QtWebEngine.
I usually use my browser with a one-window-per-workspace flow. If I
click on a URL anywhere, I personally would prefer it to go to the
browser instance that's on the same workspace.
To this end, the easiest way to accomplish this is to simply track when
windows are made visible and register them as the last visible object.
(To get finer control for when you have multiple windows on the same
workspace, focus changes also update the last visible object - the
implication being here that focusing something also means you're looking
at it)
Not all users may like this behavior, so I consider it strictly optional.
This was currently almost completely broken, yet nobody complained. The
new behavior (in the previous commit) makes this always hide the mouse
cursor, even when an input field has focus.
Since the only two easy options to implement are "never hide" and
"always hide", combined with the fact that both are sort of useless to
an end-user, just remove the option until somebody wants it back.
Right now, get('last-focused-main-window') essentially returns the same
as qApp.activeWindow(), since it's None when no window is focused. This
seems somewhat contrary to its original intent, so I've changed it to
only ever update the object.
This actually fixes another bug as well: on_focus_changed's new is not
always a MainWindow - in fact it's a WebView on my end. To fix this,
directly use the QApplication.activeWindow() to find the current focus.
That second bit in particular actually some related bugs that probably
nobody ever noticed or bothered reporting:
* _maybe_hide_mouse_cursor currently pretty much never gets called
* :adblock-update doesn't actually show any downloads
* ... probably more
Per one of the diff comments on #1597:
> I used to use a tuple for constant things, but nowadays I'd actually
> prefer a list as a tuple is something more heterogeneous (i.e. it
> makes sense to have a `(x, y)` point as a tuple, but a list of points
> would be a list).
> At some point I should probably change it to a list everywhere 😉
This way, all temporary downloads will end up in the same directory and
everything is cleaned up at program exit, not when the corresponding
window is closed.
`buffer` takes either a tab index or a string and focuses the specified
tab. The index can be of the form [0-9]+ which will switch to the
relevant tab in the current window or [0-9]+/[0-9]+ (that is
win_id/index) which will focus the specified window before switching
tabs. If a string is passed the list of open tabs across all windows is
sorted based on title and url (just like in the completion widget) and
the top result is selected.
There are a lot of problems and flakiness with using a real clipboard.
Instead we now have a :debug-set-fake-clipboard command to set a text, and use
logging when getting the contents.
Fixes#1285.
This hopefully helps with issues on the Windows buildbot:
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "C:\Users\florian\buildbot\slave\win8\build\.tox\py34\lib\shutil.py", line 371, in _rmtree_unsafe
os.unlink(fullname)
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\florian\\AppData\\Local\\Temp\\qutebrowser-basedir-ixuexfeu\\data\\local-storage\\qrc__0.localstorage'
Before it couldn't get deleted because Qt still kept the icon database open in
some way.
By clearing it when shutting down, this works correctly.
Fixes#1017.
This caused a PendingDeprecationWarning with Python 3.5:
Traceback (most recent call last):
File "/home/florian/proj/qutebrowser/git/qutebrowser/utils/debug.py", line 237, in log_time
yield
File "/home/florian/proj/qutebrowser/git/qutebrowser/app.py", line 433, in _init_late_modules
next(reader)
StopIteration
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/florian/proj/qutebrowser/git/qutebrowser/app.py", line 433, in _init_late_modules
next(reader)
File "/usr/lib64/python3.5/contextlib.py", line 77, in __exit__
self.gen.throw(type, value, traceback)
PendingDeprecationWarning: generator 'log_time' raised StopIteration
We want to ignore some positional arguments without ignoring flags/values - and
since there's no easy way to "unparse" an argparse namespace, we instead pass
it as json.
Also note we can't pass it as a file easily, as args have to be available very
early. Passing it as an argument shouldn't be an issue though.
Before, we always loaded the default session (if it existed) and then deleted
it. This was surprising as the default session was deleted even when another
session was loaded.
Now we don't delete it at all, and save the session to load in the state file.
See #523.
A better solution is to use QSocketNotifier and os.wakeup_fd to get notified
about new signals.
Thanks to Yuya Nishihara / TortoiseHG for the hint!
Fixes#555.
Before, we initialized the completions once for every window spawned, which was
a waste of CPU-time and RAM.
Now we only initialize them once, when the user uses the completion for the
first time.
This turns off searching no matter what autosearch is set to, and also makes it
possible to use fuzzy_url before the config is up.
For now, we use this for quickmarks and the startpage.
We already attempted this in c5a2039da4, but
having the directories as module attributes means they'll be created on start
(rather than when they're actually used), and it'd also be impossible to change
them after init for some reason in the future.
To still have a nice short API, we simply change the attributes to functions.