Changeset View
Changeset View
Standalone View
Standalone View
placement.cpp
Show First 20 Lines • Show All 241 Lines • ▼ Show 20 Line(s) | 241 | if (y + ch > area.bottom() && ch < area.height()) { | |||
---|---|---|---|---|---|
242 | overlap = h_wrong; // this throws the algorithm to an exit | 242 | overlap = h_wrong; // this throws the algorithm to an exit | ||
243 | } else if (x + cw > area.right()) { | 243 | } else if (x + cw > area.right()) { | ||
244 | overlap = w_wrong; | 244 | overlap = w_wrong; | ||
245 | } else { | 245 | } else { | ||
246 | overlap = none; //initialize | 246 | overlap = none; //initialize | ||
247 | 247 | | |||
248 | cxl = x; cxr = x + cw; | 248 | cxl = x; cxr = x + cw; | ||
249 | cyt = y; cyb = y + ch; | 249 | cyt = y; cyb = y + ch; | ||
250 | ToplevelList::ConstIterator l; | 250 | for (auto l = workspace()->stackingOrder().constBegin(); l != workspace()->stackingOrder().constEnd() ; ++l) { | ||
251 | for (l = workspace()->stackingOrder().constBegin(); l != workspace()->stackingOrder().constEnd() ; ++l) { | | |||
252 | AbstractClient *client = qobject_cast<AbstractClient*>(*l); | 251 | AbstractClient *client = qobject_cast<AbstractClient*>(*l); | ||
253 | if (isIrrelevant(client, c, desktop)) { | 252 | if (isIrrelevant(client, c, desktop)) { | ||
254 | continue; | 253 | continue; | ||
255 | } | 254 | } | ||
256 | xl = client->x(); yt = client->y(); | 255 | xl = client->x(); yt = client->y(); | ||
257 | xr = xl + client->width(); yb = yt + client->height(); | 256 | xr = xl + client->width(); yb = yt + client->height(); | ||
258 | 257 | | |||
259 | //if windows overlap, calc the overall overlapping | 258 | //if windows overlap, calc the overall overlapping | ||
Show All 31 Lines | |||||
291 | 290 | | |||
292 | // really need to loop? test if there's any overlap | 291 | // really need to loop? test if there's any overlap | ||
293 | if (overlap > none) { | 292 | if (overlap > none) { | ||
294 | 293 | | |||
295 | possible = area.right(); | 294 | possible = area.right(); | ||
296 | if (possible - cw > x) possible -= cw; | 295 | if (possible - cw > x) possible -= cw; | ||
297 | 296 | | |||
298 | // compare to the position of each client on the same desk | 297 | // compare to the position of each client on the same desk | ||
299 | ToplevelList::ConstIterator l; | 298 | for (auto l = workspace()->stackingOrder().constBegin(); l != workspace()->stackingOrder().constEnd() ; ++l) { | ||
300 | for (l = workspace()->stackingOrder().constBegin(); l != workspace()->stackingOrder().constEnd() ; ++l) { | | |||
301 | AbstractClient *client = qobject_cast<AbstractClient*>(*l); | 299 | AbstractClient *client = qobject_cast<AbstractClient*>(*l); | ||
302 | if (isIrrelevant(client, c, desktop)) { | 300 | if (isIrrelevant(client, c, desktop)) { | ||
303 | continue; | 301 | continue; | ||
304 | } | 302 | } | ||
305 | 303 | | |||
306 | xl = client->x(); yt = client->y(); | 304 | xl = client->x(); yt = client->y(); | ||
307 | xr = xl + client->width(); yb = yt + client->height(); | 305 | xr = xl + client->width(); yb = yt + client->height(); | ||
308 | 306 | | |||
Show All 13 Lines | |||||
322 | // ... else ==> not enough x dimension (overlap was wrong on horizontal) | 320 | // ... else ==> not enough x dimension (overlap was wrong on horizontal) | ||
323 | else if (overlap == w_wrong) { | 321 | else if (overlap == w_wrong) { | ||
324 | x = area.left(); | 322 | x = area.left(); | ||
325 | possible = area.bottom(); | 323 | possible = area.bottom(); | ||
326 | 324 | | |||
327 | if (possible - ch > y) possible -= ch; | 325 | if (possible - ch > y) possible -= ch; | ||
328 | 326 | | |||
329 | //test the position of each window on the desk | 327 | //test the position of each window on the desk | ||
330 | ToplevelList::ConstIterator l; | 328 | for (auto l = workspace()->stackingOrder().constBegin(); l != workspace()->stackingOrder().constEnd() ; ++l) { | ||
331 | for (l = workspace()->stackingOrder().constBegin(); l != workspace()->stackingOrder().constEnd() ; ++l) { | | |||
332 | AbstractClient *client = qobject_cast<AbstractClient*>(*l); | 329 | AbstractClient *client = qobject_cast<AbstractClient*>(*l); | ||
333 | if (isIrrelevant(client, c, desktop)) { | 330 | if (isIrrelevant(client, c, desktop)) { | ||
334 | continue; | 331 | continue; | ||
335 | } | 332 | } | ||
336 | 333 | | |||
337 | xl = client->x(); yt = client->y(); | 334 | xl = client->x(); yt = client->y(); | ||
338 | xr = xl + client->width(); yb = yt + client->height(); | 335 | xr = xl + client->width(); yb = yt + client->height(); | ||
339 | 336 | | |||
▲ Show 20 Lines • Show All 641 Lines • Show Last 20 Lines |