Skip to content

GitLab

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

Closed
Open
Created May 04, 2016 by Bugzilla@bugzilla-migration💬Reporter

Changed behaviour of gtk_style_context_get_color

Submitted by Morten Welinder

Link to original bug (#765982)

Description

Gtk+ 3.20 changed behaviour of gtk_style_context_get_color. It used to be correct to have a state argument different from the state of the context; now those have to be the same.

This is unreasonable.

I am sure there are good, internal reasons why the states must match, but gtk+ has all the pieces needed for hiding the change. It makes much more sense to have the work-around in one spot in Gtk+ than having the work-around in 100 places in 100 applications. The pain is 10000 times bigger in the latter case.

The recommended work-around is

save_state
set_state (state)
get_color
restore_state

although as pointed out in bug 765921, that doesn't actually work. Alternatively one can use

old = get_state
if (old != state) set_state (state)
get_color
if (old != state) set_state (old)

I think this work-around should be added to gtk_style_context_get_color or further downstream. That will allow existing code -- including binaries -- to keep working. It will also work with already-changed code.

Version: 3.22.x

Assignee
Assign to
Time tracking