5 ex_gui_frameless_drag_8c example
gullradriel edited this page 2026-10-09 00:51:57 +02:00

ex_gui_frameless_drag.c

A press on a widget in a movable frameless window is not a window drag (headless). A frameless window without N_GUI_WIN_FIXED_POSITION is dragged by its body. The press handler used to start that drag after handing the press to the widget under the pointer, so a press on a slider started both: the window then followed the pointer exactly, the slider's position inside its own window never changed, and the slider did not move at all. The same held for a scrollbar and for anything else that is dragged.

The rule now is that a press a widget took is not a window drag. A press on the empty body still is, and so is a press on a widget that does nothing with a press - here an image - so a window made mostly of pictures can still be moved.