void minimizeButtonPressed(){
// do smth
}
it works ok when I click the button “_” at the top right corner of my window.
But when I right-click the rectangle at the bottom system panel and choose “minimize” - it doesn’t call my function.
Yeah, like it says in the comments, that’s a callback for the actual minimise button. If you need to know when the state changes for other reasons, there’s a minimisationStateChanged method too.