Opened 14 years ago

Closed 12 years ago

#5472 closed bug (fixed)

[LaunchBox] "Set description" window appears offscreen

Reported by: diver Owned by: stippi
Priority: normal Milestone: R1
Component: Applications/LaunchBox Version: R1/Development
Keywords: gsoc2011 Cc:
Blocked By: Blocking:
Platform: All

Description

Tested with hrev35600 in VirtualBox 3.0.12.

Attachments (2)

always-center.diff (283 bytes ) - added by GeneralMaximus 13 years ago.
Always center the edit description window on screen.
add_offsets.diff (626 bytes ) - added by GeneralMaximus 13 years ago.

Download all attachments as: .zip

Change History (8)

by GeneralMaximus, 13 years ago

Attachment: always-center.diff added

Always center the edit description window on screen.

comment:1 by GeneralMaximus, 13 years ago

patch: 01

comment:2 by yourpalal, 13 years ago

Keywords: gsoc2011 added

First of all, thanks for looking in to this!

I don't think centering the NamePanel every single time it appears is the best way to solve this problem. For one thing, there are mechanisms in place in Launchbox that save the frame of the NamePanel, so that its location and size persist, even between boots. With this patch, you lost that functionality, but the code that actually carries out those actions (saving/loading the frame and so on) is still active.

One of the factors contributing to the undesired behaviour here is the make_sure_frame_is_on_screen() function (in support.cpp), which, if the frame is off to the left top (as fNamePanelFrame is, when it isn't loaded from the settings file) places the frame in the top left corner. Preferably, when fNamePanelFrame is invalid, the NamePanel would be placed near the LaunchBox window, instead of the top left corner.

by GeneralMaximus, 13 years ago

Attachment: add_offsets.diff added

comment:3 by GeneralMaximus, 13 years ago

Turns out the window was not really off the screen. make_sure_frame_is_on_screen just needed to take window borders into account when calculating the left and top edges of the window. Adding an offset of 5.0 fixes the issue.

Is there a way to get the border width programmatically instead of hardcoding the value?

in reply to:  3 comment:4 by anevilyak, 13 years ago

Replying to GeneralMaximus:

Is there a way to get the border width programmatically instead of hardcoding the value?

If I recall correctly, you can retrieve that via BWindow::GetDecoratorSettings(), c.f. http://dev.haiku-os.org/browser/haiku/trunk/headers/os/interface/Window.h#L210

comment:5 by stippi, 12 years ago

I think the solution should be to open the name panel near the LaunchBox panel for which the request is being made. Nothing should be saved in the settings except perhaps the user changed window size.

comment:6 by stippi, 12 years ago

Resolution: fixed
Status: newclosed

I've solved the problem differently in hrev42975 by placing the window near the mouse and to the side of the pad window that has enough room.

Note: See TracTickets for help on using tickets.