|
@@ -92,7 +92,8 @@ int main( int argc, char** argv ) {
|
92
|
92
|
case 0: {
|
93
|
93
|
// If xengine has found a window we're hovering over (or if it changed)
|
94
|
94
|
// create a rectangle around it so the user knows he/she can click on it.
|
95
|
|
- if ( window != xengine->m_hoverXWindow ) {
|
|
95
|
+ // --but only if the user wants us to
|
|
96
|
+ if ( window != xengine->m_hoverXWindow && options->m_window ) {
|
96
|
97
|
// Make sure to delete the old selection rectangle.
|
97
|
98
|
if ( windowselection ) {
|
98
|
99
|
xengine->removeRect( windowselection ); // removeRect also dealloc's the rectangle for us.
|
|
@@ -185,11 +186,19 @@ int main( int argc, char** argv ) {
|
185
|
186
|
}
|
186
|
187
|
}
|
187
|
188
|
// Otherwise lets grab the window's dimensions and use those (with padding).
|
188
|
|
- slop::WindowRectangle t = xengine->m_hoverWindow;
|
189
|
|
- x = t.m_x - padding - t.m_border;
|
190
|
|
- y = t.m_y - padding - t.m_border;
|
191
|
|
- w = t.m_width + t.m_border + padding*2;
|
192
|
|
- h = t.m_height + t.m_border + padding*2;
|
|
189
|
+ // --but only if the user lets us, if the user doesn't just select a single pixel there.
|
|
190
|
+ if ( options->m_window ) {
|
|
191
|
+ slop::WindowRectangle t = xengine->m_hoverWindow;
|
|
192
|
+ x = t.m_x - padding - t.m_border;
|
|
193
|
+ y = t.m_y - padding - t.m_border;
|
|
194
|
+ w = t.m_width + t.m_border + padding*2;
|
|
195
|
+ h = t.m_height + t.m_border + padding*2;
|
|
196
|
+ } else {
|
|
197
|
+ x = cx;
|
|
198
|
+ y = cy;
|
|
199
|
+ w = 1;
|
|
200
|
+ h = 1;
|
|
201
|
+ }
|
193
|
202
|
printf( "X=%i\n", x );
|
194
|
203
|
printf( "Y=%i\n", y );
|
195
|
204
|
printf( "W=%i\n", w );
|