Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 549658
Collapse All | Expand All

(-)gui/kmixdockwidget.cpp (-6 / +6 lines)
Lines 268-300 Link Here
268
	// Now handle Multihead displays. And also make sure that the dialog is not
268
	// Now handle Multihead displays. And also make sure that the dialog is not
269
	// moved out-of-the screen on the right (see Bug 101742).
269
	// moved out-of-the screen on the right (see Bug 101742).
270
	const QDesktopWidget* vdesktop = QApplication::desktop();
270
	const QDesktopWidget* vdesktop = QApplication::desktop();
271
	const QRect& vScreenSize = vdesktop->availableGeometry(dockAreaPopup);
271
	int screenNumber = vdesktop->screenNumber(pos);
272
	const QRect& vScreenSize = vdesktop->availableGeometry(screenNumber);
272
273
273
	if ((x + dockAreaPopup->width()) > (vScreenSize.width() + vScreenSize.x()))
274
	if ((x + dockAreaPopup->width()) > (vScreenSize.width() + vScreenSize.x()))
274
	{
275
	{
275
		// move horizontally, so that it is completely visible
276
		// move horizontally, so that it is completely visible
276
		x = vScreenSize.width() + vScreenSize.x() - dockAreaPopup->width() - 1;
277
		x = vScreenSize.width() + vScreenSize.x() - dockAreaPopup->width() - 1;
277
		kDebug()
278
		kDebug() << "Multihead: (case 1) moving to" << x << "." << y;
278
		<< "Multihead: (case 1) moving to" << vScreenSize.x() << "," << vScreenSize.y();
279
	}
279
	}
280
	else if (x < vScreenSize.x())
280
	else if (x < vScreenSize.x())
281
	{
281
	{
282
		// horizontally out-of bound
282
		// horizontally out-of bound
283
		x = vScreenSize.x();
283
		x = vScreenSize.x();
284
		kDebug() << "Multihead: (case 2) moving to" << vScreenSize.x() << "," << vScreenSize.y();
284
		kDebug() << "Multihead: (case 2) moving to" << x << "." << y;
285
	}
285
	}
286
286
287
	if ((y + dockAreaPopup->height()) > (vScreenSize.height() + vScreenSize.y()))
287
	if ((y + dockAreaPopup->height()) > (vScreenSize.height() + vScreenSize.y()))
288
	{
288
	{
289
		// move horizontally, so that it is completely visible
289
		// move horizontally, so that it is completely visible
290
		y = vScreenSize.height() + vScreenSize.y() - dockAreaPopup->height() - 1;
290
		y = vScreenSize.height() + vScreenSize.y() - dockAreaPopup->height() - 1;
291
		kDebug() << "Multihead: (case 3) moving to" << vScreenSize.x() << "," << vScreenSize.y();
291
		kDebug() << "Multihead: (case 3) moving to" << x << "." << y;
292
	}
292
	}
293
	else if (y < vScreenSize.y())
293
	else if (y < vScreenSize.y())
294
	{
294
	{
295
		// horizontally out-of bound
295
		// horizontally out-of bound
296
		y = vScreenSize.y();
296
		y = vScreenSize.y();
297
		kDebug() << "Multihead: (case 4) moving to" << vScreenSize.x() << "," << vScreenSize.y();
297
		kDebug() << "Multihead: (case 4) moving to" << x << "." << y;
298
	}
298
	}
299
299
300
300

Return to bug 549658