After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 633460 - better support for background-position
better support for background-position
Status: RESOLVED OBSOLETE
Product: gnome-shell
Classification: Core
Component: st
2.91.x
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on: 633462
Blocks: 624383
 
 
Reported: 2010-10-29 13:33 UTC by Jakub Steiner
Modified: 2021-07-05 14:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to implement a full compliant background-position CSS property (18.93 KB, patch)
2011-01-16 17:01 UTC, Quentin "Sardem FF7" Glidic
none Details | Review
Patch to implement a full compliant background-position CSS property (18.83 KB, patch)
2011-01-17 17:07 UTC, Quentin "Sardem FF7" Glidic
none Details | Review
Patch to implement a full compliant background-position CSS property (18.94 KB, patch)
2011-01-19 12:37 UTC, Quentin "Sardem FF7" Glidic
needs-work Details | Review
Patch to implement a full compliant background-position CSS property (20.07 KB, patch)
2011-07-10 21:21 UTC, Quentin "Sardem FF7" Glidic
needs-work Details | Review
Patch to implement a full compliant background-position CSS property (17.97 KB, patch)
2012-02-09 17:09 UTC, Quentin "Sardem FF7" Glidic
needs-work Details | Review

Description Jakub Steiner 2010-10-29 13:33:45 UTC
Initial implementation of background-position (See bug #624375) only implements absolute units. I would appreciate extending the functionality to support "bottom" so that .panel-button:active state can be implemented with a background SVG aligned to the bottom edge of the block.
Comment 1 drago01 2010-10-30 19:07:47 UTC
I intentionally didn't add any relative values due to bug 610879 .

Adding support for bottom should be doable though.
Comment 2 Quentin "Sardem FF7" Glidic 2011-01-16 15:08:49 UTC
Patch submitted in bug 624383
Comment 3 Quentin "Sardem FF7" Glidic 2011-01-16 17:01:54 UTC
Created attachment 178449 [details] [review]
Patch to implement a full compliant background-position CSS property

Patch to apply on top of the background-size patch from bug 633462.

This patch is also needed by radial gradients for patch 624383.
Comment 4 Quentin "Sardem FF7" Glidic 2011-01-17 17:07:29 UTC
Created attachment 178530 [details] [review]
Patch to implement a full compliant background-position CSS property

Little corrections to the background clean part.
Comment 5 Quentin "Sardem FF7" Glidic 2011-01-19 12:37:20 UTC
Created attachment 178715 [details] [review]
Patch to implement a full compliant background-position CSS property

Rebase the patch on top of the new background-size patch
Comment 6 Jasper St. Pierre (not reading bugmail) 2011-07-08 09:12:24 UTC
Review of attachment 178715 [details] [review]:

::: src/st/st-theme-background-position.c
@@ +1,3 @@
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
+/*
+ * st-background_position.c: background_position structure to ease the draw

st-theme-background-position.c

@@ +22,3 @@
+
+void
+st_theme_background_position_init(StThemeBackgroundPosition *background_position)

Again, do we need a fancy refcounted struct for this?

Seems like just a regular struct would be more than adequate.

::: src/st/st-theme-node-drawing.c
@@ +362,3 @@
+                           gdouble                   *y)
+{
+  gdouble tx, ty, ox, oy;

Why not just use these inline? Compilers optimize all that away, and you're left with cleaner, more readable code.

@@ +453,3 @@
       h *= sy;
     }
+

Drop it.

::: src/st/st-theme-node.c
@@ +1575,3 @@
+        {
+          orient = ST_FROM_TOP;
+          goto checkend;

Can we restructure this without goto? It's hard to follow like this.

@@ +1797,3 @@
                 }
+                /*
+                 * TODO: check the segfault

This patch is not ready then.
Comment 7 Quentin "Sardem FF7" Glidic 2011-07-10 21:21:23 UTC
Created attachment 191652 [details] [review]
Patch to implement a full compliant background-position CSS property

Sorry, again, here is the real patch.
Comment 8 Jasper St. Pierre (not reading bugmail) 2011-07-10 21:42:09 UTC
Review of attachment 191652 [details] [review]:

Most of the comments in my last review still apply. Can you fix those?
Comment 9 drago01 2011-07-10 21:50:21 UTC
Review of attachment 191652 [details] [review]:

::: src/st/st-theme-background-position.c
@@ +3,3 @@
+ * st-background_position.c: background_position structure to ease the draw
+ *
+ * Copyright 2011 Sardem FF7

IANAL but I doubt this has any legal meaning.
Comment 10 Florian Müllner 2012-01-27 16:41:54 UTC
Ping? We still have fallout from the background-size patch, which looks like it needs background-position to fix (the placeholder in the dash/workspace switcher, the highlight effect of panel buttons). If we cannot fix the fallout in time for 3.4, we'll have to revert the background-size stuff (which would be a pity, because being as CSS-compliant as possible is still a good thing)
Comment 11 Quentin "Sardem FF7" Glidic 2012-02-09 17:09:15 UTC
Created attachment 207203 [details] [review]
Patch to implement a full compliant background-position CSS property

It still needs some work on the parsing to avoid some gotos.
Comment 12 Jasper St. Pierre (not reading bugmail) 2012-02-10 16:06:56 UTC
Review of attachment 207203 [details] [review]:

Better. Still would like to see the removal of the bitfield and the gotos. Splitting them into separate functions may help restructure the code flow.

::: src/st/st-theme-node-drawing.c
@@ +438,2 @@
 static void
+get_background_coordinates (StThemeBackgroundPosition *background_position,

Any specific reason we're passing the BackgroundPosition instead of the node? We can retrieve the BackgroundPosition from the node.

@@ +477,3 @@
+      break;
+      case ST_FROM_NONE:
+        offset_x = offset_y = 0;

case fallthrough looks like a bug. Just use the more explicit:

  case ST_FROM_NONE:
    (*x) = 0;
    (*y) = 0;
  break;
Comment 13 GNOME Infrastructure Team 2021-07-05 14:26:58 UTC
GNOME is going to shut down bugzilla.gnome.org in favor of  gitlab.gnome.org.
As part of that, we are mass-closing older open tickets in bugzilla.gnome.org
which have not seen updates for a longer time (resources are unfortunately
quite limited so not every ticket can get handled).

If you can still reproduce the situation described in this ticket in a recent
and supported software version, then please follow
  https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines
and create a new ticket at
  https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/

Thank you for your understanding and your help.