Skip to content
This repository has been archived by the owner on May 20, 2023. It is now read-only.

MediaDisplay not focusing the right item #26

Open
CodedOre opened this issue Jan 5, 2022 · 6 comments
Open

MediaDisplay not focusing the right item #26

CodedOre opened this issue Jan 5, 2022 · 6 comments
Labels
Bug Upstream Related to an issue upstream
Milestone

Comments

@CodedOre
Copy link
Owner

CodedOre commented Jan 5, 2022

In an ideal case MediaDisplay should initially display the item that was selected in the preview, by scrolling the used Adw.Carousel to the focused position.

However, for some reason it does not, always displaying the first media instead.

Noting this here as I don't know where exactly the bug is and as it is not a priority now, but would be glad if someone else with the time can debug this.

@CodedOre CodedOre added the Bug label Jan 5, 2022
@CodedOre CodedOre added the Good to Start Good Issue to start with if you want to contribute label Mar 9, 2022
@CodedOre CodedOre added Upstream Related to an issue upstream and removed Good to Start Good Issue to start with if you want to contribute labels Apr 12, 2022
@CodedOre
Copy link
Owner Author

This seems to be an issue in libadwaita.

@IBBoard
Copy link
Contributor

IBBoard commented Apr 12, 2022

Had a quick poke and it isn't even working in the realize signal, so it's not just a constructor issue. I added this to the constructor and still see item 1:

    carousel.realize.connect_after (() => {
      print("Realized carousel - setting scroll\n");
      var widget = (Gtk.Label)carousel.get_nth_page (2);
      print("Widget text: %s\n", widget.label);
      carousel.scroll_to (widget, false);
    });

Turning the labels into buttons and putting it on the clicked signal works, though. Odd.

(Also, it took me far longer than it should to work out how to change the carousel! I tried clicking the bars, up and down arrows, left and right arrows, page up and page down…)

@IBBoard
Copy link
Contributor

IBBoard commented Apr 12, 2022

this.show and carousel.map aren't working either. Even with connect_after. Surely they're late enough in the process that it can change the page?!

@IBBoard
Copy link
Contributor

IBBoard commented Apr 12, 2022

Ahah! Added this:

    carousel.page_changed.connect ((page) => {
      print(@"Carousel changes to page $(page)\n");
    });

And get this:

Realized carousel - setting scroll
Widget text: Item 3
Carousel changes to page 0
Mapping carousel
Mapping carousel - setting scroll
Widget text: Item 3
Carousel changes to page 0

So it is trying to swap but getting page 0 each time. Which is odd, because I'm getting its Nth page and should get a valid object!

@CodedOre
Copy link
Owner Author

@Exalm has mentioned on Matrix that scroll_to might only work after Adw.Carousel is allocated.
My guess is it might have to do with Adw.Animation being used for scrolling...

That thing is pretty sure an upstream issue.

@IBBoard
Copy link
Contributor

IBBoard commented Apr 12, 2022

I need to find a description of the GTK widget cycle. The class docs assume so much internal knowledge. I've never known where half of these events fit. The description for realize made it sound like it was basically the end of the process.

@CodedOre CodedOre added this to the 2.0 milestone Oct 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Upstream Related to an issue upstream
Projects
None yet
Development

No branches or pull requests

2 participants