Commit ac4dfd675cdfd23293759878505957459393006f

Authored by ksamak
1 parent 09073808

changed relation type

plugins/ezoom/src/ezoom.cpp
... ... @@ -314,70 +314,6 @@ EZoomScreen::adjustXYVelocity (int out,
314 314 (zooms.at (out).yVelocity * chunk) / cScreen->redrawTime ();
315 315 }
316 316  
317   -// correct showmouse's targeting according to mouse centering algorythm
318   -CompPoint
319   -EZoomScreen::getModifiedMousePosition (const CompPoint &p)
320   -{
321   - int out = screen->outputDeviceForPoint (pointerX, pointerY);
322   - CompOutput *o = &screen->outputDevs ().at (out);
323   -
324   - if (zooms.at (out).newZoom == 1.0f) {
325   - return p;
326   - }
327   - if (optionGetAlwaysCenterMouse()) {
328   - if (optionGetRestrainZoomToScreen()) {
329   - int x_shift = o->width() / 2;
330   - if (o->width() * (0.5f + zooms.at (out).xTranslate) == 0) {
331   - x_shift = static_cast<int>(p.x() / zooms.at (out).newZoom);
332   - } else if (o->width() * (0.5f + zooms.at (out).xTranslate) == o->width() ) {
333   - x_shift = static_cast<int>(o->width() - (o->width() - p.x()) / zooms.at (out).newZoom);
334   - }
335   - int y_shift = o->height() / 2;
336   - if (o->height() * (0.5f + zooms.at (out).yTranslate) == 0) {
337   - y_shift = static_cast<int>(p.y() / zooms.at (out).newZoom);
338   - } else if (o->height() * (0.5f + zooms.at (out).yTranslate) == o->height() ) {
339   - y_shift = static_cast<int>(o->height() - (o->height() - p.y()) / zooms.at (out).newZoom);
340   - }
341   - return {x_shift, y_shift};
342   - }
343   - return {o->width() / 2, o->height() / 2};
344   - }
345   -
346   - //float zoomCorrection = 1.0f - zooms.at(out).newZoom; // this correction allows constant centering of the mouse
347   -
348   - // legaly centering algorythm
349   - int x_shift = p.x();
350   - int y_shift = p.y();
351   -
352   - // coordinate system conversion
353   - // one lead:
354   - //float x_2 = static_cast<float>(x_shift) / o->width() * (0.92f) + 0.5f;
355   - //float y_2 = static_cast<float>(y_shift) / o->height() * (0.92f) + 0.5f;
356   -
357   - // working ok, but for one variable to find
358   - //float x_2 = static_cast<float>(x_shift) * 1.08f / (o->width()) * 0.92f / zooms.at(out).newZoom +0.5f;
359   - //float y_2 = static_cast<float>(y_shift) * 1.08f / (o->height()) * 0.92f / zooms.at(out).newZoom +0.5f;
360   - //x_shift = (x_2 - 0.5f) * o->width() * (1 - zooms.at(out).newZoom); // + o->width() * 0.08 * (1 - zooms.at(out).newZoom);
361   - //y_shift = (y_2 - 0.5f) * o->height() * (1 - zooms.at(out).newZoom); // + o->height() * 0.08 * (1 - zooms.at(out).newZoom);
362   -
363   - float x_2 = static_cast<float>(x_shift) / (o->width()) * 0.92f / zooms.at(out).newZoom + 0.46f;
364   - float y_2 = static_cast<float>(y_shift) / (o->height()) * 0.92f / zooms.at(out).newZoom +0.46f;
365   -
366   - x_shift = (x_2 - 0.46f) * o->width() * (1 - zooms.at(out).newZoom) + o->width() / 2 * 0.08f;
367   - y_shift = (y_2 - 0.46f) * o->height() * (1 - zooms.at(out).newZoom) + o->height() / 2 * 0.08f;
368   -
369   - std::cout << x_shift << std::endl;
370   - std::cout << ":" << std::endl;
371   - //if (x_shift < o->width()/2) {
372   - // x_shift /= 0.92f;
373   - //}
374   - //if (y_shift < o->height()/2) {
375   - // y_shift /= 0.92f;
376   - //}
377   - return {x_shift, y_shift};
378   - //return {static_cast<int>((p.x() - o->width()/2) * 0.92f), static_cast<int>((o->height() + p.y()) * 0.92 - o->height())};
379   -}
380   -
381 317 /* Animate the movement (if any) in preparation of a paint screen. */
382 318 void
383 319 EZoomScreen::preparePaint (int msSinceLastPaint)
... ...
plugins/ezoom/src/ezoom.h
... ... @@ -180,9 +180,6 @@ class EZoomScreen :
180 180  
181 181 public:
182 182  
183   - CompPoint
184   - getModifiedMousePosition (const CompPoint &p);
185   -
186 183 void
187 184 preparePaint (int);
188 185  
... ...
plugins/showmouse/CMakeLists.txt
1 1 find_package (Compiz REQUIRED)
2 2  
3 3 include (CompizPlugin)
4   -include_directories (${CMAKE_SOURCE_DIR}/plugins/ezoom/src/)
5 4  
6   -compiz_plugin (showmouse PLUGINDEPS composite opengl mousepoll INCDIRS LIBRARIES ezoom )
  5 +compiz_plugin (showmouse PLUGINDEPS composite opengl mousepoll)
... ...
plugins/showmouse/showmouse.xml.in
... ... @@ -8,14 +8,15 @@
8 8 <relation type="after">
9 9 <plugin>opengl</plugin>
10 10 <plugin>mousepoll</plugin>
11   - <plugin>ezoom</plugin>
12 11 <plugin>cube</plugin>
13 12 <plugin>decor</plugin>
14 13 </relation>
  14 + <relation type="before">
  15 + <plugin>ezoom</plugin>
  16 + </relation>
15 17 <requirement>
16 18 <plugin>opengl</plugin>
17 19 <plugin>mousepoll</plugin>
18   - <plugin>ezoom</plugin>
19 20 </requirement>
20 21 </deps>
21 22 <options>
... ...
plugins/showmouse/src/showmouse.cpp
... ... @@ -28,8 +28,6 @@
28 28 */
29 29  
30 30 #include "showmouse.h"
31   -#include "ezoom.h"
32   -#include <iostream>
33 31  
34 32 COMPIZ_PLUGIN_20090315 (showmouse, ShowmousePluginVTable);
35 33  
... ... @@ -489,8 +487,7 @@ ShowmouseScreen::doDamageRegion ()
489 487 void
490 488 ShowmouseScreen::positionUpdate (const CompPoint &p)
491 489 {
492   - ZOOM_SCREEN (screen);
493   - mousePos = zs->getModifiedMousePosition(p);
  490 + mousePos = p;
494 491 }
495 492  
496 493 void
... ...