File tree Expand file tree Collapse file tree 4 files changed +9
-7
lines changed
Expand file tree Collapse file tree 4 files changed +9
-7
lines changed Original file line number Diff line number Diff line change 2222#include "main.h"
2323#include <X11/Xlib.h>
2424#include <X11/Xatom.h>
25+ #include <cairo/cairo-xlib.h>
2526
2627wxBitmap * fixImage (wxString img , int type , wxColour c );
2728wxBitmap * getRootWallpaper ();
Original file line number Diff line number Diff 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*
609609MyFrame::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 }
Original file line number Diff line number Diff 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}
196195wxPoint simImage::center ()
197196{
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments