File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
druid-shell/src/backend/gtk Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -983,7 +983,19 @@ impl WindowHandle {
983983 pub fn set_position ( & self , mut position : Point ) {
984984 if let Some ( state) = self . state . upgrade ( ) {
985985 if let Some ( parent_state) = & state. parent {
986- let pos = ( * parent_state) . get_position ( ) ;
986+ let pos = if let Some ( parent_state) = parent_state. 0 . state . upgrade ( ) {
987+ let parent_window = & ( * parent_state) . window ;
988+ let ( root_x, root_y) = match state. window . type_hint ( ) {
989+ WindowTypeHint :: Tooltip | WindowTypeHint :: DropdownMenu => {
990+ // position relative to the content area
991+ parent_window. window ( ) . unwrap ( ) . position ( )
992+ }
993+ _ => parent_window. position ( ) ,
994+ } ;
995+ Point :: new ( root_x as f64 , root_y as f64 ) . to_dp ( state. scale . get ( ) )
996+ } else {
997+ ( * parent_state) . get_position ( )
998+ } ;
987999 position += ( pos. x , pos. y )
9881000 }
9891001 } ;
You can’t perform that action at this time.
0 commit comments