MCPcopy Create free account
hub / github.com/LemonOSProject/LemonOS / MouseRight

Method MouseRight

System/LemonWM/wm.cpp:362–382  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

360}
361
362void WMInstance::MouseRight(bool pressed){
363 auto it = windows.end();
364 do {
365 WMWindow* win = *it;
366
367 if(PointInWindowProper(win, input.mouse.pos)){
368 Lemon::LemonEvent ev;
369
370 if(pressed){
371 ev.event = Lemon::EventRightMousePressed;
372 } else {
373 ev.event = Lemon::EventRightMouseReleased;
374 }
375
376 ev.mousePos = input.mouse.pos - win->pos;
377 if(!(win->flags & WINDOW_FLAGS_NODECORATION)) ev.mousePos = ev.mousePos - (vector2i_t){1, 25};
378
379 PostEvent(ev, win);
380 }
381 } while (it-- != windows.begin());
382}
383
384void WMInstance::MouseUp(){
385 if(contextMenuActive && Lemon::Graphics::PointInRect(contextMenuBounds, input.mouse.pos)){

Callers 1

PollMethod · 0.80

Calls 3

PointInWindowProperFunction · 0.85
endMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected