<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>389033</bug_id>
          
          <creation_ts>2018-01-16 01:54:19 +0000</creation_ts>
          <short_desc>&quot;Show Pixel Grid&quot; checkbox state can desync with multiple documents/views</short_desc>
          <delta_ts>2018-01-30 08:21:51 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>krita</product>
          <component>Usability</component>
          <version>git master (please specify the git hash!)</version>
          <rep_platform>Compiled Sources</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Nicholas LaPointe">nicholaslapointe8</reporter>
          <assigned_to name="Scott Petrovic">scottpetrovic</assigned_to>
          <cc>dimula73</cc>
    
    <cc>freebox64</cc>
    
    <cc>halla</cc>
          
          <cf_commitlink>https://commits.kde.org/krita/95b2c02b0bac26cf87788a4ef31c8640635204cf</cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1722460</commentid>
    <comment_count>0</comment_count>
    <who name="Nicholas LaPointe">nicholaslapointe8</who>
    <bug_when>2018-01-16 01:54:19 +0000</bug_when>
    <thetext>The &quot;checked&quot; state of the &quot;Show Pixel Grid&quot; checkbox inside of the &quot;View&quot; menu can be inaccurate when it is toggled in multiple documents or views.

(Steps assume that the pixel grid is already enabled, which it is by default)
1. Create two documents
2. Disable the pixel grid in one document
3. Switch documents. The pixel grid in this document will still be enabled, but the checkbox is now unchecked.

I&apos;d expect that the state of the checkbox would match the status of the pixel grid on the view (versus the other alternative of the checkbox affecting all views).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1722507</commentid>
    <comment_count>1</comment_count>
    <who name="mvowada">freebox64</who>
    <bug_when>2018-01-16 10:44:41 +0000</bug_when>
    <thetext>Yes. I can confirm on Ubuntu 14.04 with Krita 4.0.0-beta1.1 and OpenGL enabled.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1722877</commentid>
    <comment_count>2</comment_count>
    <who name="Halla Rempt">halla</who>
    <bug_when>2018-01-17 11:04:29 +0000</bug_when>
    <thetext>Probably caused by 

commit cb1e38118be3e986a252210fa8df61a8fc2d4b18
Author: Scott Petrovic &lt;scottpetrovic@gmail.com&gt;
Date:   Sat Oct 28 09:44:18 2017 -0500

    turned the show pixel grid into an action and moved it to the view menu</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1722967</commentid>
    <comment_count>3</comment_count>
    <who name="Scott Petrovic">scottpetrovic</who>
    <bug_when>2018-01-17 14:25:41 +0000</bug_when>
    <thetext>The pixel grid is on/off based on the kritarc currently. It only currently works globally, not per view.

We will have to code something up so it keeps track of the enabled status by view and remove it from being on/off in the kritarc.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1722989</commentid>
    <comment_count>4</comment_count>
    <who name="Halla Rempt">halla</who>
    <bug_when>2018-01-17 15:18:36 +0000</bug_when>
    <thetext>&gt; The pixel grid is on/off based on the kritarc currently. It only currently
&gt; works globally, not per view.

The weird thing is that there is some per-view code, or so it seems. I think
that&apos;s not necessary, actually.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1723470</commentid>
    <comment_count>5</comment_count>
    <who name="Nicholas LaPointe">nicholaslapointe8</who>
    <bug_when>2018-01-18 23:11:02 +0000</bug_when>
    <thetext>I could imagine per-view control of it being helpful when a user has multiple views of the same document at different zoom levels, but I don&apos;t know how common such a use case would be.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1723578</commentid>
    <comment_count>6</comment_count>
    <who name="Scott Petrovic">scottpetrovic</who>
    <bug_when>2018-01-19 13:44:54 +0000</bug_when>
    <thetext>Git commit 1a47ae24712377821994c3b0309b9437da129d73 by Scott Petrovic.
Committed on 19/01/2018 at 13:44.
Pushed by scottpetrovic into branch &apos;master&apos;.

M  +0    -5    libs/ui/KisViewManager.cpp
M  +0    -16   libs/ui/canvas/kis_canvas_controller.cpp
M  +0    -1    libs/ui/canvas/kis_canvas_controller.h
M  +11   -0    libs/ui/kis_paintop_box.cc
M  +3    -0    libs/ui/kis_paintop_box.h
M  +4    -3    libs/ui/opengl/kis_opengl_canvas2.cpp

https://commits.kde.org/krita/1a47ae24712377821994c3b0309b9437da129d73</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1723580</commentid>
    <comment_count>7</comment_count>
    <who name="Scott Petrovic">scottpetrovic</who>
    <bug_when>2018-01-19 13:48:36 +0000</bug_when>
    <thetext>I fixed the bug with it syncing.

For now the pixel grid is going to have to be a global option and not per view. That was how it was coded and the way it is saved/loaded with the kritarc. It is really a settings option that wasn&apos;t designed to be in the main menu.

If we start getting requests for people needing it differently per view, that can be a future feature request.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1725586</commentid>
    <comment_count>8</comment_count>
    <who name="Dmitry Kazakov">dimula73</who>
    <bug_when>2018-01-29 07:57:26 +0000</bug_when>
    <thetext>Hi, Scott!

There is still a bug with sync&apos;ness:

When switching the state of the checkbox in one view, the **state of the checkbox** in another view goes out of sync :(</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1725591</commentid>
    <comment_count>9</comment_count>
    <who name="Dmitry Kazakov">dimula73</who>
    <bug_when>2018-01-29 08:28:57 +0000</bug_when>
    <thetext>Added a review request:
https://phabricator.kde.org/D10171</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1725828</commentid>
    <comment_count>10</comment_count>
    <who name="Dmitry Kazakov">dimula73</who>
    <bug_when>2018-01-30 08:21:51 +0000</bug_when>
    <thetext>Git commit 95b2c02b0bac26cf87788a4ef31c8640635204cf by Dmitry Kazakov.
Committed on 29/01/2018 at 08:27.
Pushed by dkazakov into branch &apos;master&apos;.

Fix syncing pixel grid state between windows once again

Summary:
This patch extends commit1a47ae24712377821994c3b0309b9437da129d73 and
addresses the following issues:

1) The state of the menu action checkbox was not updated when the other
   window changed the its state
2) There should be **no** access to KisConfig in the OpenGL rendering
   loop (it is slow due to possible disk access).
3) A canvas update call should be issued right after the config changed,
   otherwise the old state of the grid will be visible until one hovers
   the canvas

Test Plan:
1) Open multiple Krita windows and zoom both of them to 1000%
2) Change View-&gt;Show Pixel Grid in one of the windows
3) The state on the checkbox and the canvas should automatically
   update in the other window

Reviewers: #krita, scottpetrovic

Differential Revision: https://phabricator.kde.org/D10171

M  +1    -0    libs/ui/KisMainWindow.cpp
M  +16   -0    libs/ui/KisViewManager.cpp
M  +1    -0    libs/ui/KisViewManager.h
M  +9    -0    libs/ui/canvas/kis_canvas_controller.cpp
M  +1    -0    libs/ui/canvas/kis_canvas_controller.h
M  +5    -0    libs/ui/kis_config_notifier.cpp
M  +2    -0    libs/ui/kis_config_notifier.h
M  +0    -11   libs/ui/kis_paintop_box.cc
M  +0    -3    libs/ui/kis_paintop_box.h
M  +15   -6    libs/ui/opengl/kis_opengl_canvas2.cpp
M  +1    -0    libs/ui/opengl/kis_opengl_canvas2.h

https://commits.kde.org/krita/95b2c02b0bac26cf87788a4ef31c8640635204cf</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>