fix for click on title_bar
fix for click on title_bar

- Check null pointer for swayc_parent_by_type
- Split lines to follow coding style

SirCmpwn/sway,4e554c4c/sway,taiyu-len/sway,sleep-walker/sway,4e554c4c/sway,ascent12/sway,johalun/sway,mikkeloscar/sway,1ace/sway,taiyu-len/sway,ascent12/sway,mikkeloscar/sway,sleep-walker/sway,ascent12/sway,1ace/sway,ptMuta/sway,1ace/sway,taiyu-len/sway