MCPcopy Create free account
hub / github.com/LibreSprite/LibreSprite / offerCapture

Method offerCapture

src/ui/widget.cpp:1283–1302  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1281}
1282
1283bool Widget::offerCapture(ui::MouseMessage* mouseMsg, int widget_type)
1284{
1285 if (hasCapture()) {
1286 Widget* pick = manager()->pick(mouseMsg->position());
1287 if (pick && pick != this && pick->type() == widget_type) {
1288 releaseMouse();
1289
1290 MouseMessage* mouseMsg2 = new MouseMessage(
1291 kMouseDownMessage,
1292 mouseMsg->pointerType(),
1293 mouseMsg->buttons(),
1294 mouseMsg->modifiers(),
1295 mouseMsg->position());
1296 mouseMsg2->addRecipient(pick);
1297 manager()->enqueueMessage(mouseMsg2);
1298 return true;
1299 }
1300 }
1301 return false;
1302}
1303
1304bool Widget::hasFocus()
1305{

Callers

nothing calls this directly

Calls 8

pickMethod · 0.80
buttonsMethod · 0.80
addRecipientMethod · 0.80
enqueueMessageMethod · 0.80
positionMethod · 0.45
typeMethod · 0.45
pointerTypeMethod · 0.45
modifiersMethod · 0.45

Tested by

no test coverage detected