Skip to content
GitLab
    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
    Projects Groups Topics Snippets
  • Register
  • Sign in
  • Lazarus Lazarus
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
    • Locked files
  • Issues 2,097
    • Issues 2,097
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 14
    • Merge requests 14
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test cases
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • FPC
  • LazarusLazarus
  • LazarusLazarus
  • Issues
  • #35270
Closed
Open
Issue created Mar 25, 2019 by FPC Admin account@fpc_adminOwner

Handling mouse events through shaped TWinControl

Original Reporter info from Mantis: ptvs
  • Reporter name:

Description:

If you position TGraphicControl decendant under TWinControl decendant, and then
change TWinControl's shape with SetShape so that TGraphicControl become visible,
all mouse events on the TGraphicControl would be handled by the form.

This happens in TWinControl.IsControlMouseMsg():
[code]
// do query wincontrol children, in case they overlap
Control := ControlAtPos(SmallPointToPoint(MouseMessage.Pos),
[capfAllowWinControls]);
if Control is TWinControl then
begin

  // there is a TWinControl child at this position
  // TWinControl children get their own messages
  // => ignore here
  Control := nil;

end;
[/code]
ControlAtPos() searches for TWinControl first (capfAllowWinControls in Flags),
finds one, does not check for children (no capfRecursive in Flags) and returns
the control. And the control is set to nil. (This seems a bit senseless to me)
So, as no control found at mouse position the event handling is given to the
form.

I deleted capfAllowWinControls flag from the call, and it worked as expected
(tested on Windows 7).

I attached example project and a patch, please test.

Mantis conversion info:

  • Mantis ID: 35270
  • OS: Microsoft Windows 7 SP1 x86
  • OS Build: 6.1.7601
  • Platform: Intel Core i3-7100
  • Version: 2.1 (SVN)
  • Fixed in revision: r61053 (#60961061)
Assignee
Assign to
Time tracking