mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-22 20:25:59 +01:00
fix non-gdk popups on multimon
This commit is contained in:
parent
9d06c61242
commit
df6a3c6877
2 changed files with 6 additions and 12 deletions
|
@ -18,8 +18,8 @@
|
|||
void addPopupGlobalCoords(void* pPopup, int* x, int* y) {
|
||||
SXDGPopup *const PPOPUP = (SXDGPopup*)pPopup;
|
||||
|
||||
int px = PPOPUP->monitor->vecPosition.x;
|
||||
int py = PPOPUP->monitor->vecPosition.y;
|
||||
int px = 0;
|
||||
int py = 0;
|
||||
|
||||
auto curPopup = PPOPUP;
|
||||
while (true) {
|
||||
|
@ -72,8 +72,8 @@ void Events::listener_newPopup(void* owner, void* data) {
|
|||
const auto PMONITOR = g_pCompositor->getMonitorFromID(layersurface->monitorID);
|
||||
|
||||
PNEWPOPUP->popup = WLRPOPUP;
|
||||
PNEWPOPUP->lx = layersurface->position.x;
|
||||
PNEWPOPUP->ly = layersurface->position.y;
|
||||
PNEWPOPUP->lx = layersurface->position.x - PMONITOR->vecPosition.x;
|
||||
PNEWPOPUP->ly = layersurface->position.y - PMONITOR->vecPosition.y;
|
||||
PNEWPOPUP->monitor = PMONITOR;
|
||||
createNewPopup(WLRPOPUP, PNEWPOPUP);
|
||||
}
|
||||
|
@ -93,8 +93,8 @@ void Events::listener_newPopupXDG(void* owner, void* data) {
|
|||
const auto PMONITOR = g_pCompositor->getMonitorFromID(PWINDOW->m_iMonitorID);
|
||||
|
||||
PNEWPOPUP->popup = WLRPOPUP;
|
||||
PNEWPOPUP->lx = PWINDOW->m_vEffectivePosition.x;
|
||||
PNEWPOPUP->ly = PWINDOW->m_vEffectivePosition.y;
|
||||
PNEWPOPUP->lx = PWINDOW->m_vEffectivePosition.x - PMONITOR->vecPosition.x;
|
||||
PNEWPOPUP->ly = PWINDOW->m_vEffectivePosition.y - PMONITOR->vecPosition.y;
|
||||
PNEWPOPUP->parentWindow = PWINDOW;
|
||||
PNEWPOPUP->monitor = PMONITOR;
|
||||
createNewPopup(WLRPOPUP, PNEWPOPUP);
|
||||
|
|
|
@ -18,12 +18,6 @@ void renderSurface(struct wlr_surface* surface, int x, int y, void* data) {
|
|||
double outputX = 0, outputY = 0;
|
||||
wlr_output_layout_output_coords(g_pCompositor->m_sWLROutputLayout, RDATA->output, &outputX, &outputY);
|
||||
|
||||
if (RDATA->pMonitor) { // BUG THIS TODO: this is just to show the popup on a monitor that isnt at 0,0
|
||||
// the popups are broken.
|
||||
x -= ((SMonitor*)RDATA->pMonitor)->vecPosition.x;
|
||||
y -= ((SMonitor*)RDATA->pMonitor)->vecPosition.y;
|
||||
}
|
||||
|
||||
wlr_box windowBox;
|
||||
if (RDATA->surface && surface == RDATA->surface) {
|
||||
windowBox = {(int)outputX + RDATA->x + x, (int)outputY + RDATA->y + y, RDATA->w, RDATA->h};
|
||||
|
|
Loading…
Reference in a new issue