Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
5c95985
Enable ImGui docking + multi-viewport so panels can be dragged into t…
Sajeeth-Wimalasuriyan Apr 21, 2026
f74dafd
Tidy up comments from docking/multi-viewport change
Sajeeth-Wimalasuriyan Apr 21, 2026
c6ee01d
Fix secondary viewport/OS position mismatch during drag
tomk-amd Apr 28, 2026
24e0d51
Moved linux specific window positioning work arounds to newly created…
tomk-amd Apr 28, 2026
dad6411
Fix cursor click fallthrough bug after window drag on linux wayland.
tomk-amd Apr 28, 2026
d4395b9
Fix build on various linux platforms
tomk-amd Apr 28, 2026
17e3738
Remove X11 build dependency.
tomk-amd Apr 29, 2026
5a9e5ee
Add drag-repair option for Linux Wayland users
tomk-amd Apr 30, 2026
17583d5
Refine drag-repair option for Linux Wayland users
tomk-amd Apr 30, 2026
8d80404
Disable ImGui window docking
Sajeeth-Wimalasuriyan May 25, 2026
b260e56
Merge remote-tracking branch 'origin/dev' into sw-window-docking
Sajeeth-Wimalasuriyan May 25, 2026
fed2545
Remove custom DPI handling, switch to ImGui auto-DPI font sizing
Sajeeth-Wimalasuriyan May 26, 2026
a86aa7b
Fix internal build banner positioning under multi-viewports and DPI s…
Sajeeth-Wimalasuriyan May 28, 2026
b034b95
Fix status bar scrollbar sliver under auto-DPI font scaling
Sajeeth-Wimalasuriyan May 28, 2026
0194b40
Size status bar slot to content + border, drop NoScrollbar workaround
Sajeeth-Wimalasuriyan Jun 9, 2026
22f2cc3
Restore GLFW_SCALE_TO_MONITOR window hint
Sajeeth-Wimalasuriyan Jun 10, 2026
b492e8a
Merge branch 'dev' into sw-window-docking
tomk-amd Jun 10, 2026
217d678
Merge sw-dpi-removal into sw-window-docking
Sajeeth-Wimalasuriyan Jun 10, 2026
18c8e5e
merge fix
tomk-amd Jun 10, 2026
b1b9278
changed order of log init (make first)
tomk-amd Jun 10, 2026
744b196
Merge origin/sw-window-docking (new push) into local DPI-removal work
Sajeeth-Wimalasuriyan Jun 10, 2026
056f1be
Code cleanup:
tomk-amd Jun 10, 2026
0128522
Merge origin/main into sw-window-docking
Sajeeth-Wimalasuriyan Aug 12, 2026
c79e239
Fix runaway detached-window geometry under DPI changes
Sajeeth-Wimalasuriyan Aug 12, 2026
a9c444d
Bump ImGui to v1.92.9b-docking and adapt Vulkan descriptor pool
Sajeeth-Wimalasuriyan Aug 13, 2026
b1b27b3
Potential fix for pull request finding 'CodeQL / Catching by value'
Sajeeth-Wimalasuriyan Aug 13, 2026
eec6200
Fix CodeQL format specifier and nullness findings
Sajeeth-Wimalasuriyan Aug 13, 2026
8b4893e
Fix fullscreen behaviour with dragged-out panels on Linux
tomk-amd Aug 18, 2026
28db2dc
Gate multi-viewport behind ROCPROFVIS_MULTI_WINDOW
Sajeeth-Wimalasuriyan Sep 2, 2026
ac3edec
Gate Linux drag-repair behind ROCPROFVIS_MULTI_WINDOW
Sajeeth-Wimalasuriyan Sep 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .agents/UI.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ CMake options worth knowing:
- `ROCPROFVIS_ENABLE_REMOTE` - enables SSH connection, browse, transfer,
and remote-trace UI (default off). Remote profiling needs both remote
and profiler support.
- `ROCPROFVIS_ENABLE_TRACE_COMPARE` - enables the in-development trace
comparison UI (default off).
Comment thread
Sajeeth-Wimalasuriyan marked this conversation as resolved.
Resolved
- `ROCPROFVIS_MULTI_WINDOW` - enables the in-development multi-window
support (default off).
- `USE_NATIVE_FILE_DIALOG` - off disables `nativefiledialog-extended`.

The CLI flag `--file-dialog={auto|imgui|native}` overrides dialog selection
Expand Down
16 changes: 15 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ option(ROCPROFVIS_ENABLE_REMOTE "Build with remote/SSH support (in development)"
# remote-profiling glue (RemoteProfilerSession / SshProfilerExecutor) is only
# built when BOTH are enabled.

# TEMPORARY: gate the in-development trace-compare and multi-window features
# until they ship. Both default OFF so release builds exclude their UI and
# dependent sources. Remove these options and unwrap their guards when the
# features graduate.
option(ROCPROFVIS_ENABLE_TRACE_COMPARE "Build with trace comparison support (in development)" OFF)
option(ROCPROFVIS_MULTI_WINDOW "Build with multi-window support (in development)" OFF)

if(ROCPROFVIS_DEVELOPER_MODE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DROCPROFVIS_DEVELOPER_MODE")
endif(ROCPROFVIS_DEVELOPER_MODE)
Expand All @@ -54,6 +61,12 @@ endif(ROCPROFVIS_ENABLE_REMOTE)
if(ROCPROFVIS_ENABLE_INTERNAL_BANNER)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DROCPROFVIS_ENABLE_INTERNAL_BANNER")
endif(ROCPROFVIS_ENABLE_INTERNAL_BANNER)
if(ROCPROFVIS_ENABLE_TRACE_COMPARE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DROCPROFVIS_ENABLE_TRACE_COMPARE")
endif(ROCPROFVIS_ENABLE_TRACE_COMPARE)
if(ROCPROFVIS_MULTI_WINDOW)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DROCPROFVIS_MULTI_WINDOW")
endif(ROCPROFVIS_MULTI_WINDOW)

# Set GLFW library type based on option
if(GLFW_LINK_STATIC)
Expand Down Expand Up @@ -252,7 +265,8 @@ set(APP_FILES
src/app/src/rocprofvis_imgui_vulkan.cpp
src/app/src/rocprofvis_imgui_opengl.cpp
src/app/src/glfw_util.cpp
src/app/src/rocprofvis_cli_parser.cpp)
src/app/src/rocprofvis_cli_parser.cpp
src/app/src/rocprofvis_platform_helpers.cpp)
if(APPLE)
list(APPEND APP_FILES src/app/src/rocprofvis_platform_helpers_macos.mm)
endif()
Expand Down
177 changes: 112 additions & 65 deletions src/app/src/glfw_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,19 @@ namespace RocProfVis
namespace View
{

// Upper bound on the corrective resizes issued after leaving fullscreen. The
// window manager normally settles within one or two corrections; the budget
// only exists so a geometry the window manager refuses outright cannot make us
// retry forever.
constexpr int WINDOWED_RESTORE_MAX_CORRECTIONS = 8;

// How long to keep watching the window after leaving fullscreen. This cannot
// stop at the first frame where the geometry looks right: the window manager's
// own reply to glfwSetWindowMonitor() can arrive tens of milliseconds later and
// move the window again, so the watch has to outlive it. Measured worst case on
// GNOME/Xwayland was under 50 ms.
constexpr double WINDOWED_RESTORE_WATCH_SECONDS = 0.5;

void
init_fullscreen_state(GLFWwindow* window, FullscreenState& state)
{
Expand All @@ -22,7 +35,9 @@ init_fullscreen_state(GLFWwindow* window, FullscreenState& state)
// Detect if window is already in fullscreen mode
// glfwGetWindowMonitor returns nullptr if windowed, or monitor handle if fullscreen
GLFWmonitor* monitor = glfwGetWindowMonitor(window);
state.is_fullscreen = (monitor != nullptr);
state.is_fullscreen = (monitor != nullptr);
state.restore_attempts = 0;
state.restore_deadline = 0.0;

if(!state.is_fullscreen)
{
Expand Down Expand Up @@ -115,6 +130,11 @@ toggle_fullscreen(GLFWwindow* window, FullscreenState& state)
glfwSetWindowMonitor(window, nullptr, state.windowed_xpos, state.windowed_ypos,
state.windowed_width, state.windowed_height, GLFW_DONT_CARE);
state.is_fullscreen = false;
// The geometry handed to glfwSetWindowMonitor() is frequently not what
// the window ends up with, so arrange for it to be checked and
// corrected over the next few frames.
state.restore_attempts = WINDOWED_RESTORE_MAX_CORRECTIONS;
state.restore_deadline = glfwGetTime() + WINDOWED_RESTORE_WATCH_SECONDS;
}
else
{
Expand All @@ -141,90 +161,117 @@ toggle_fullscreen(GLFWwindow* window, FullscreenState& state)
rocprofvis_view_set_fullscreen_state(state.is_fullscreen);
}

// Leaving fullscreen with glfwSetWindowMonitor() asks for the saved windowed
// geometry, but the request is not reliably honoured: on GNOME/Xwayland the
// position and size are applied to the window frame rather than to the content
// area that glfwGetWindowPos()/glfwGetWindowSize() reported when the geometry
// was saved. The window therefore came back one title bar lower and one title
// bar shorter, and because the shrunken size was saved on the next toggle the
// loss accumulated on every F11.
//
// glfwSetWindowPos()/glfwSetWindowSize() are symmetric with the getters the
// geometry was saved from, so re-applying through them lands the window
// exactly. They cannot be called from toggle_fullscreen() directly, because at
// that point the window manager has not finished leaving fullscreen and simply
// overrides them; the correction has to happen on a later frame, which is why
// this is driven from the render loop.
//
// The watch also cannot stop at the first frame where the geometry matches. The
// window manager's own reply to glfwSetWindowMonitor() can land after the
// correction has already been applied and move the window a second time, so the
// window is watched until the deadline set when fullscreen was left.
void
settle_windowed_geometry(GLFWwindow* window, FullscreenState& state)
{
if(!window || state.restore_attempts <= 0)
{
return;
}

if(state.is_fullscreen || glfwGetTime() > state.restore_deadline)
{
state.restore_attempts = 0;
return;
}

int xpos = 0;
int ypos = 0;
int width = 0;
int height = 0;
glfwGetWindowPos(window, &xpos, &ypos);
glfwGetWindowSize(window, &width, &height);

if(xpos == state.windowed_xpos && ypos == state.windowed_ypos &&
width == state.windowed_width && height == state.windowed_height)
{
return;
}

spdlog::debug("Correcting windowed geometry: ({},{}) {}x{} -> ({},{}) {}x{}", xpos,
ypos, width, height, state.windowed_xpos, state.windowed_ypos,
state.windowed_width, state.windowed_height);

glfwSetWindowPos(window, state.windowed_xpos, state.windowed_ypos);
glfwSetWindowSize(window, state.windowed_width, state.windowed_height);
state.restore_attempts--;
}

void
sync_fullscreen_state(GLFWwindow* window, int width, int height, FullscreenState& state)
{
if(!window) return;
if(!window)
{
return;
}

// Check if window is actually in fullscreen mode (as OS may have changed it)
// This runs from the GLFW window-size callback and must only reconcile
// state, never drive the window. An earlier version called
// glfwSetWindowMonitor() here to force the window back to windowed mode,
// which re-entered GLFW from inside its own event handler and fought the
// fullscreen transition that was still in progress.
bool is_actually_fullscreen = is_fullscreen_active(window);

// If state is out of sync, update it
if(state.is_fullscreen != is_actually_fullscreen)
if(state.is_fullscreen == is_actually_fullscreen)
{
spdlog::debug("Detected OS-initiated fullscreen change: {} -> {}",
state.is_fullscreen ? "fullscreen" : "windowed",
is_actually_fullscreen ? "fullscreen" : "windowed");
return;
}

state.is_fullscreen = is_actually_fullscreen;
spdlog::debug("Detected OS-initiated fullscreen change: {} -> {}",
state.is_fullscreen ? "fullscreen" : "windowed",
is_actually_fullscreen ? "fullscreen" : "windowed");

// If we exited fullscreen, save the new windowed dimensions
if(!is_actually_fullscreen)
{
glfwGetWindowPos(window, &state.windowed_xpos, &state.windowed_ypos);
state.windowed_width = width;
state.windowed_height = height;
// Restore windowed mode (set monitor to nullptr)
glfwSetWindowMonitor(window, nullptr, state.windowed_xpos, state.windowed_ypos,
state.windowed_width, state.windowed_height, GLFW_DONT_CARE);
}
state.is_fullscreen = is_actually_fullscreen;

// Notify view layer
rocprofvis_view_set_fullscreen_state(state.is_fullscreen);
// Remember the geometry so the next exit from fullscreen can restore it.
if(!is_actually_fullscreen)
{
glfwGetWindowPos(window, &state.windowed_xpos, &state.windowed_ypos);
state.windowed_width = width;
state.windowed_height = height;
}

rocprofvis_view_set_fullscreen_state(state.is_fullscreen);
}

bool
is_fullscreen_active(GLFWwindow* window)
{
if (!window) return false;

GLFWmonitor* monitor = glfwGetWindowMonitor(window);
if (!monitor)
if(!window)
{
return false;
}

// If monitor is set, window should be in exclusive fullscreen mode, but
// if mode was changed to windowed via OS, glfw might be out of sync.

// Get current window size/pos
int wx = 0, wy = 0, ww = 0, wh = 0;
glfwGetWindowPos(window, &wx, &wy);
glfwGetWindowSize(window, &ww, &wh);

// Monitor video mode and workarea
const GLFWvidmode* mode = glfwGetVideoMode(monitor);
int mx = 0, my = 0;
#if defined(GLFW_VERSION_MAJOR) && GLFW_VERSION_MAJOR >= 3
// GLFW 3.4+ has workarea; older versions may not
int work_x = 0, work_y = 0, work_w = 0, work_h = 0;
glfwGetMonitorWorkarea(monitor, &work_x, &work_y, &work_w, &work_h);
#endif
glfwGetMonitorPos(monitor, &mx, &my);

// Allow some tolerance for WM adjustments (borders, rounding)
constexpr int TOL = 2;

#if defined(GLFW_VERSION_MAJOR) && GLFW_VERSION_MAJOR >= 3
// Try matching workarea first (accounts for taskbars, panels)
bool matches_workarea =
(std::abs(wx - work_x) <= TOL) &&
(std::abs(wy - work_y) <= TOL) &&
(std::abs(ww - work_w) <= TOL) &&
(std::abs(wh - work_h) <= TOL);
#else
bool matches_workarea = false;
#endif

bool matches_vidmode =
mode &&
(std::abs(wx - mx) <= TOL) &&
(std::abs(wy - my) <= TOL) &&
(std::abs(ww - mode->width) <= TOL) &&
(std::abs(wh - mode->height) <= TOL);

return matches_workarea || matches_vidmode;
// glfwGetWindowMonitor() is non-null exactly while the window is fullscreen,
// so it is the whole answer.
//
// Cross-checking the window geometry against the monitor's video mode was
// tried here and removed. Under Xwayland with fractional scaling enabled
// (mutter's scale-monitor-framebuffer) the reported window size and the
// XRandR video mode legitimately disagree, so the comparison declared a
// genuinely fullscreen window "windowed". sync_fullscreen_state() then
// forced it back to windowed mode on the first resize event after every
// F11, which is what made fullscreen appear to toggle at random.
return glfwGetWindowMonitor(window) != nullptr;
}

} // namespace View
Expand Down
21 changes: 16 additions & 5 deletions src/app/src/glfw_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,17 @@ constexpr int DEFAULT_WINDOWED_HEIGHT = 720;
// Structure to track fullscreen state
struct FullscreenState
{
bool is_fullscreen;
int windowed_xpos;
int windowed_ypos;
int windowed_width;
int windowed_height;
bool is_fullscreen;
int windowed_xpos;
int windowed_ypos;
int windowed_width;
int windowed_height;
// Remaining corrective resizes allowed while putting the window back to the
// windowed geometry after leaving fullscreen, and the time at which to stop
// watching for the window manager to disturb it. See
// settle_windowed_geometry().
int restore_attempts;
double restore_deadline;
};

// Initialize fullscreen state with current window position and size
Expand All @@ -37,6 +43,11 @@ GLFWmonitor* get_current_monitor(GLFWwindow* window);
// Toggle between fullscreen and windowed mode
void toggle_fullscreen(GLFWwindow* window, FullscreenState& state);

// Re-apply the saved windowed geometry after a return from fullscreen, if the
// window manager did not land the window where it was asked to. Call once per
// frame from the render loop; it is a no-op unless a restore is outstanding.
void settle_windowed_geometry(GLFWwindow* window, FullscreenState& state);

// Sync fullscreen state with actual window state (in case of OS-initiated changes)
void sync_fullscreen_state(GLFWwindow* window, int width, int height, FullscreenState& state);

Expand Down
Loading
Loading