Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The entire UI flickers every time there is an API sync #185

Closed
heartsucker opened this issue Nov 26, 2018 · 3 comments · Fixed by #216
Closed

The entire UI flickers every time there is an API sync #185

heartsucker opened this issue Nov 26, 2018 · 3 comments · Fixed by #216
Assignees
Labels
bug Something isn't working component/UI

Comments

@heartsucker
Copy link
Contributor

It seems as if the whole app disappears and is repainted after the sync. I use xfcd/xmonad on my desktop, and the "flicker" affects other tiles which leads me to believe that the whole display actually disappears and reappears, and not just that the app has a strange flash itself during this repainting.

(on master at commit 1e96664)

@redshiftzero redshiftzero added bug Something isn't working component/UI labels Nov 26, 2018
@heartsucker
Copy link
Contributor Author

This is a hard blocker for #16. Attempting to compose a message will result in the message content being deleted during a "flicker".

@heartsucker heartsucker self-assigned this Dec 3, 2018
@heartsucker
Copy link
Contributor Author

Trying to work on this now by using the QAbstractModel pattern for all the data the GUI needs to render.

@redshiftzero
Copy link
Contributor

Taking a step back, the entire pane is flashing for two reasons:

  1. the ConversationView is the parent of several other objects which should be more cleanly separated (currently the ConversationView represents almost the entire right hand side of the client) and,
  2. because we always redraw when either an API sync completes or every few seconds, even if nothing changed

To resolve issue 1, the right side of the client should be a container object that contains:

  • ConversationView
  • SourceProfileShortWidget which itself contains widgets
  • the reply field

(Currently SourceProfileShortWidget and the reply box are children of ConversationView)

API syncs or updates as messages/replies are decrypted should only modify the ConversationView part of the UI. Just adding this container object and resolving issue 1 should be sufficient to unblock the reply feature (let me know if you disagree) and would need to be done even when we move to using QAbstractModel.

To resolve issue 2 I agree we should move to QAbstractModel. ConversationView would be a QAbstractModel which will resolve the flashing and will only render updates when a change is made (btw I did a bit of experimenting here today using QAbstractListModel which may be a useful reference). Using this MVC pattern should reduce code complexity as the UI will just reflect the models so we no longer need to explicitly redraw the UI when something changes - that should be done by qt's signals and slots which we get for free when we use the qt models properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working component/UI
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants