Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • evince evince
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 718
    • Issues 718
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 40
    • Merge requests 40
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOME
  • evinceevince
  • Merge requests
  • !373

Draft: port Evince to gtk4

  • Review changes

  • Download
  • Email patches
  • Plain diff
Open Qiu Wenbo requested to merge crab2313/evince:gtk4-port-target into main Aug 17, 2021
  • Overview 74
  • Commits 72
  • Pipelines 43
  • Changes 134

This is my work in progress GTK4 port of Evince.

I'm really excited when I got my HiFive Unmatched development board, but sadly it has a poor performance quad-core RISC-V SoC. The performance of most gtk3 based GNOME apps on this board is really bad and I can't use this RISC-V PC as my daily drive. For example, Evince renders 0.5 FPS when you scroll a PDF document. That motivate me to port several GNOME apps to GTK4 since GTK4 use OpenGL by default to render its widgets.

Now Evince on GTK4 can render 60 FPS with 4K resolution on HiFive Unmatched after addressing several performance issues. So I think it's time to open a draft merge request to get the opinion from the maintainers. This port is still incomplete and there are several features that I can't figure out how to port to GTK4.

Done

This section is basically a change log of major changes.

  • Migrate EvView and EvViewPresentation to GtkSnapshot based drawing model
  • Use box-shadow property of CSS to implement the border of pages. And this is a major performance boost since border-image make gtk_snapshot_render_frame fallbacks to cairo and causes significant frame drop (90 drop to 20 with 2K resolution).
  • Migrate a lot of custom widgets to composite template. And implement GtkBuildable interface for containers such as EvSidebar.
  • Remove EvToolbar and merge it into EvWindow since AdwTitlebar is a final class now.
  • Remove EvLoadingMessage and merge it into EvWindow since we can simply implement it by composite template.
  • Remove the original media playback code and switch to GtkVideo
  • GPU accelerated transition effect of presentation mode

TODO

  • port accessibility stuff of Evince
  • migrate every sidebar page to composite template. That means, we construct them by adding a new <child> of EvSidebar
  • make sure dispose method of every widget free the resource. Since most child widget of custom widget is managed by composite template and do not require destroy manually
  • style tuning, since there is a lot of use of border attribute of containers
  • make sure other document backends working as exptected
  • figure out the missing event of button 3 of GtkTreeView
  • EvSearchBox need a rewrite since GtkSearchEntry is no longer a GtkEntry
  • night mode switch do not queue a redraw for current page
  • implement inverted color by GPU rather than cairo
  • split text selection related event handler into a separated event controller
  • bring back form fields to EvView
  • DnD support for EvView
  • bring back the key binding handler of EvView
  • bring back the caret mode of EvView
  • wait for the builtin spell check of GTK4 since the authors of gspell state that they are not going to port gspell to GTK4 gtk#3814
  • GtkStackSwitcher in GTK4 lost its homogeneous property gtk#4152 (closed)

Fixes: #1072 #1551

Edited Jun 24, 2022 by Qiu Wenbo
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: gtk4-port-target