elementary / portals

Home Page:https://elementary.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AppChooser doesn't work with mouse

janxkoci opened this issue · comments

What Happened?

It seems I cannot use mouse (touchpad) to select apps in AppChooser portal, only keyboard works (arrows up and down, then Enter).

The AppChooser portal is usually triggered when I want to open some file, e.g. after downloading it with Epiphany and clicking on it in the downloads popover, or when opening a file from archive in File Roller.

One example:

Snímek z 2022-04-23 15-27-07

Steps to Reproduce

  1. Trigger the AppChooser portal (e.g. download a file with Epiphany and try to open it from popover, or open some zip archive and right-click some file inside it to "open" it);
  2. AppChooser opens;
  3. Try to select an app with mouse click.

Expected Behavior

The app is selected and I can click the "Open" button to open it. I should also be able to double-click the app in the list to directly open it (thus skipping the "Open" button).

OS Version

6.x (Odin)

Software Version

Latest release (I have run all updates)

Log Output

No response

Hardware Info

This is on a Slimbook Essential 14" laptop and its built-in touchpad.

Snímek z 2022-03-21 10-48-39

commented

Can confirm on OS 7

I think this is because we're adding the entire of the window as the WindowHandle, which seems to override the button press event:

var grid = new Gtk.Grid () {
orientation = Gtk.Orientation.VERTICAL,
column_spacing = 12,
row_spacing = 6,
margin = 12
};
grid.attach (overlay, 0, 0, 1, 2);
grid.attach (primary_label, 1, 0);
grid.attach (secondary_label, 1, 1);
grid.attach (frame, 0, 3, 2);
grid.attach (button_box, 1, 4);
var window_handle = new Hdy.WindowHandle ();
window_handle.add (grid);

The similar issue was seen in IconBrowser and fixed in elementary/iconbrowser#21, so maybe we can fix this in the similar way too?

If I am not mistaken, window handle has above_child property inherited from Gtk.EventBox, but it would not be ideal since we cannot use it anymore when we port to GTK4. I think the fix done in iconbrowser will do.