Skip to content

Commit d612862

Browse files
committed
Clicks on the border below starter now trigger the starters
This improves vastly how easy it is to click on the starters when the dock is at the bottom of the screen.
1 parent 5377229 commit d612862

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

src/background.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "main.h"
2323
#include <X11/Xlib.h>
2424
#include <X11/Xatom.h>
25+
#include <cairo/cairo-xlib.h>
2526

2627
wxBitmap *fixImage (wxString img, int type, wxColour c);
2728
wxBitmap* getRootWallpaper();

src/myFrame.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ MyFrame::OnRightClick (wxMouseEvent & event)
381381
for (unsigned int i = 0; i < ImagesList->GetCount (); i++)
382382
{
383383
simImage *img = (*ImagesList)[i];
384-
if (img->isIn (p.x, p.y))
384+
if (img->isIn (p.x, p.y, settings.BOTTOM_BORDER))
385385
{
386386
clickedID = i;
387387
break;
@@ -609,7 +609,7 @@ simImage*
609609
MyFrame::getClickedIcon(wxMouseEvent & event) {
610610
for (unsigned int i = 0; i < ImagesList->GetCount (); i++) {
611611
simImage *img = (*ImagesList)[i];
612-
if (img->isIn (event.m_x, event.m_y)) {
612+
if (img->isIn (event.m_x, event.m_y, settings.BOTTOM_BORDER)) {
613613
return img;
614614
}
615615
}

src/simImage.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,8 @@ simImage::handleStatus ()
189189
break;
190190
}
191191
}
192-
bool simImage::isIn (int m_x, int m_y)
193-
{
194-
return m_x > x && m_y > y && m_x < x + w && m_y < y + h;
192+
bool simImage::isIn (int m_x, int m_y, int bottom_border) {
193+
return m_x > x && m_y > y && m_x < x + w && (m_y - bottom_border) < y + h;
195194
}
196195
wxPoint simImage::center()
197196
{

src/simImage.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,10 @@ class simImage
7070
bool loadImage(const wxString& path);
7171
/* Uses the current image to initialize the reflex image */
7272
void initReflex();
73-
/* Returns true if the given point is inside the simImage bounds, false otherwise */
74-
bool isIn (int x, int y);
73+
/* Returns true if the given point is inside the simImage bounds, false otherwise.
74+
* If bottom_border is given will return true even if clicked below the icon, to enable clicks at
75+
* the border of the display */
76+
bool isIn (int x, int y, int bottom_border);
7577
/* Returns the center point of the image */
7678
wxPoint center();
7779

0 commit comments

Comments
 (0)