godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.57k stars 21.27k forks source link

Slider grabbers don't disppear when scrolling in the inspector while hovered #42497

Open ghost opened 4 years ago

ghost commented 4 years ago

Godot version:

3.2.3 stable

OS/device including version:

Manjaro Linux

Issue description:

In project setting, the sliders knob stay visible, when close the window with escape key while mouse hover on any value input slider. The floating knob can be interact and change the value as in the gif.

bug

Similar to this issue #27258 happened when scroll while mouse hover on slider. If the slider at the bottom of the window, it can still happens as below

bug2

Steps to reproduce:

Explained in the issue description

Minimal reproduction project:

Schweini07 commented 4 years ago

I can confirm this too on Manjaro Linux.

trommlbomml commented 4 years ago

I can confirm on Ubuntu 20.04, too.

amoriqbal commented 4 years ago

I am on Linux Mint. (Ubuntu 20.04). I can confirm the issue on Godot 3.2 (stable) master ( #42518 ) has the issue of sliders remaining during scrolling. But the slider does not remain when the project settings window is closed. Plus, I noticed the following behaviour on master when I tried to use the slider... The mouse cursor vanishes when I click and drag the slider. The slider does not change its position, nor the value of the field changes. When I release the mouse, the cursor appears somewhere on the top left corner of the window. godot-bug

ojaohe-3 commented 4 years ago

Hello, we are a bunch of students that have tackled this issue. I think we have a solution for the artifact, when closing and a "fix " for the scroller. The issue was inside EditSpinSlider class that seem to not be updated properly, i could not really fix the scroll issue for that reason. The artifact fix was just to catch the notification_visual_change and hiding the grabber if it is still active. We are not experienced programmers so any input is valued.

EditorSpinSlider::_notification(int p_what) {
    //if grabber is visible and screen changes, hide grabber, if optimizations remove this notification fix this.
    if(p_what == NOTIFICATION_VISIBILITY_CHANGED &&  grabber->is_visible()){
            grabber->hide();
    }
//...
}

EditorSpinSlider:: _gui_input(){
//...
 else if (mb->get_button_index() == BUTTON_WHEEL_UP || mb->get_button_index() == BUTTON_WHEEL_DOWN) {
            //fix scolling issue, If the slider does not move when scrolling, this will make it hard to change the value
            if (grabber->is_visible()){
                mouse_over_spin = false; //the edit
                update();
            }
        }
}

i could make a pull request but I fear that i dont want to add more issues with this files then already are present.

MagdielM commented 3 years ago

Hello, we are a bunch of students that have tackled this issue. I think we have a solution for the artifact, when closing and a "fix " for the scroller. The issue was inside EditSpinSlider class that seem to not be updated properly, i could not really fix the scroll issue for that reason. The artifact fix was just to catch the notification_visual_change and hiding the grabber if it is still active. We are not experienced programmers so any input is valued.

EditorSpinSlider::_notification(int p_what) {
  //if grabber is visible and screen changes, hide grabber, if optimizations remove this notification fix this.
  if(p_what == NOTIFICATION_VISIBILITY_CHANGED &&  grabber->is_visible()){
          grabber->hide();
  }
//...
}

EditorSpinSlider:: _gui_input(){
//...
 else if (mb->get_button_index() == BUTTON_WHEEL_UP || mb->get_button_index() == BUTTON_WHEEL_DOWN) {
          //fix scolling issue, If the slider does not move when scrolling, this will make it hard to change the value
          if (grabber->is_visible()){
              mouse_over_spin = false; //the edit
              update();
          }
      }
}

i could make a pull request but I fear that i dont want to add more issues with this files then already are present.

Not sure if you're still interested in this, but I'd encourage you to do so. Pull requests have to be reviewed by maintainers in order to be merged, and I'm sure they'd be happy to help you iron out any issues that may surge from the changes you've made. Eventually, once it's all polished and merged, you will have helped to make Godot better for everyone :)

MewPurPur commented 1 year ago

Well, I investigated earlier, and while yes, the logic in EditorSpinSlider could be tweaked to prevent this, in 4.0.3 this appears to be an universal issue with NOTIFICATION_MOUSE_ENTER and NOTIFICATION_MOUSE_EXIT not updating at the right moment.

The first issue in the original post has been fixed. For the second one, "the right moment" is when a container updates its content based on scrolling. There are a lot more symptoms of this issue in the engine.