| 87 | } |
| 88 | |
| 89 | void random(wayfire_toplevel_view & view, wf::geometry_t workarea) |
| 90 | { |
| 91 | wf::geometry_t window = view->get_pending_geometry(); |
| 92 | wf::geometry_t area; |
| 93 | int pos_x, pos_y; |
| 94 | |
| 95 | area.x = workarea.x; |
| 96 | area.y = workarea.y; |
| 97 | area.width = workarea.width - window.width; |
| 98 | area.height = workarea.height - window.height; |
| 99 | |
| 100 | if ((area.width <= 0) || (area.height <= 0)) |
| 101 | { |
| 102 | center(view, workarea); |
| 103 | |
| 104 | return; |
| 105 | } |
| 106 | |
| 107 | pos_x = rand() % area.width + area.x; |
| 108 | pos_y = rand() % area.height + area.y; |
| 109 | |
| 110 | view->move(pos_x, pos_y); |
| 111 | } |
| 112 | |
| 113 | void center(wayfire_toplevel_view & view, wf::geometry_t workarea) |
| 114 | { |
nothing calls this directly
no test coverage detected