]> git.lizzy.rs Git - minetest.git/blobdiff - src/guiTable.cpp
Set server_announce to world.mt and respect modes when changing subgame
[minetest.git] / src / guiTable.cpp
index 845c90122c51675f7d06383b6c3af6f743c7aca6..e915770a412da09dec79233c745cfde581b1ad45 100644 (file)
@@ -28,14 +28,14 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include <IGUIScrollBar.h>
 #include "debug.h"
 #include "log.h"
-#include "tile.h"
+#include "client/tile.h"
 #include "gettime.h"
 #include "util/string.h"
 #include "util/numeric.h"
 #include "util/string.h" // for parseColorString()
-#include "main.h"
 #include "settings.h" // for settings
 #include "porting.h" // for dpi
+#include "guiscalingfilter.h"
 
 /*
        GUITable
@@ -638,10 +638,11 @@ void GUITable::draw()
        client_clip.UpperLeftCorner.Y += 1;
        client_clip.UpperLeftCorner.X += 1;
        client_clip.LowerRightCorner.Y -= 1;
-       client_clip.LowerRightCorner.X -=
-               m_scrollbar->isVisible() ?
-               skin->getSize(gui::EGDS_SCROLLBAR_SIZE) :
-               1;
+       client_clip.LowerRightCorner.X -= 1;
+       if (m_scrollbar->isVisible()) {
+               client_clip.LowerRightCorner.X =
+                               m_scrollbar->getAbsolutePosition().UpperLeftCorner.X;
+       }
        client_clip.clipAgainst(AbsoluteClippingRect);
 
        // draw visible rows
@@ -862,6 +863,14 @@ bool GUITable::OnEvent(const SEvent &event)
                // Update tooltip
                setToolTipText(cell ? m_strings[cell->tooltip_index].c_str() : L"");
 
+               // Fix for #1567/#1806:
+               // IGUIScrollBar passes double click events to its parent,
+               // which we don't want. Detect this case and discard the event
+               if (event.MouseInput.Event != EMIE_MOUSE_MOVED &&
+                               m_scrollbar->isVisible() &&
+                               m_scrollbar->isPointInside(p))
+                       return true;
+
                if (event.MouseInput.isLeftPressed() &&
                                (isPointInside(p) ||
                                 event.MouseInput.Event == EMIE_MOUSE_MOVED)) {