diff options
| author | Matthias Melcher <git@matthiasm.com> | 2021-12-05 00:40:08 +0100 |
|---|---|---|
| committer | Matthias Melcher <git@matthiasm.com> | 2021-12-05 00:40:08 +0100 |
| commit | 30371740acf46d77dd1933e206109aa73ae781bd (patch) | |
| tree | 88ed41f7fdacabb8d8c49601ae0e431ca096c32d /fluid/Fl_Window_Type.cxx | |
| parent | 204ac3dfdfd519607e2f392fa83c12fad9e73fde (diff) | |
STR #2842: new widgets will be created where the user clicked the RMB
If a user adds a new widget using the right mouse button in any of the
design's windows, the new widget will be located with its top left corner
at the selected position.
Diffstat (limited to 'fluid/Fl_Window_Type.cxx')
| -rw-r--r-- | fluid/Fl_Window_Type.cxx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fluid/Fl_Window_Type.cxx b/fluid/Fl_Window_Type.cxx index 62ed479f8..ff196d2e1 100644 --- a/fluid/Fl_Window_Type.cxx +++ b/fluid/Fl_Window_Type.cxx @@ -1176,6 +1176,9 @@ void Fl_Window_Type::moveallchildren() update_xywh(); } +int Fl_Window_Type::popupx = 0x7FFFFFFF; // mark as invalid (MAXINT) +int Fl_Window_Type::popupy = 0x7FFFFFFF; + int Fl_Window_Type::handle(int event) { static Fl_Type* selection; switch (event) { @@ -1187,8 +1190,10 @@ int Fl_Window_Type::handle(int event) { if (Fl::event_button() >= 3) { in_this_only = this; // modifies how some menu items work. static const Fl_Menu_Item* myprev; + popupx = mx; popupy = my; const Fl_Menu_Item* m = New_Menu->popup(mx,my,"New",myprev); if (m && m->callback()) {myprev = m; m->do_callback(this->o);} + popupx = 0x7FFFFFFF; popupy = 0x7FFFFFFF; // mark as invalid (MAXINT) in_this_only = 0; return 1; } |
