forge
Explore
Log in

Don't you dare go Hollow

Use is() instead of downcast().is_some()

Browse files at this commit

11633aef98fa7e7bfab42a85164377c9f4afd142Ivan MolodetskikhParent: 9193245
src/handlers/xdg_shell.rsmodified+2 -3
@@ -83,7 +83,7 @@ impl XdgShellHandler for State {
83 if focus.id().same_client_as(&wl_surface.id()) {83 if focus.id().same_client_as(&wl_surface.id()) {
84 // Deny move requests from DnD grabs to work around84 // Deny move requests from DnD grabs to work around
85 // https://gitlab.gnome.org/GNOME/gtk/-/issues/711385 // https://gitlab.gnome.org/GNOME/gtk/-/issues/7113
86- let is_dnd_grab = grab.as_any().downcast_ref::<DnDGrab<Self>>().is_some();86+ let is_dnd_grab = grab.as_any().is::<DnDGrab<Self>>();
87 87
88 if !is_dnd_grab {88 if !is_dnd_grab {
89 grab_start_data =89 grab_start_data =
@@ -103,8 +103,7 @@ impl XdgShellHandler for State {
103 if focus.id().same_client_as(&wl_surface.id()) {103 if focus.id().same_client_as(&wl_surface.id()) {
104 // Deny move requests from DnD grabs to work around104 // Deny move requests from DnD grabs to work around
105 // https://gitlab.gnome.org/GNOME/gtk/-/issues/7113105 // https://gitlab.gnome.org/GNOME/gtk/-/issues/7113
106- let is_dnd_grab =106+ let is_dnd_grab = grab.as_any().is::<DnDGrab<Self>>();
107- grab.as_any().downcast_ref::<DnDGrab<Self>>().is_some();
108 107
109 if !is_dnd_grab {108 if !is_dnd_grab {
110 grab_start_data =109 grab_start_data =